summaryrefslogtreecommitdiffstats
path: root/generic/tclLoad.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclLoad.c')
-rw-r--r--generic/tclLoad.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/generic/tclLoad.c b/generic/tclLoad.c
index 6f5b9cf..75e513d 100644
--- a/generic/tclLoad.c
+++ b/generic/tclLoad.c
@@ -470,10 +470,15 @@ Tcl_LoadObjCmd(
if (code != TCL_OK) {
Interp *iPtr = (Interp *) target;
- if (iPtr->result != NULL && iPtr->result[0] != '\0') {
- /* We have an Tcl 8.x extension with incompatible stub table. */
- Tcl_Obj *obj = Tcl_NewStringObj(iPtr->result, -1);
- Tcl_SetObjResult(interp, obj);
+ if (iPtr->legacyResult && !iPtr->legacyFreeProc) {
+ /*
+ * A call to Tcl_InitStubs() determined the caller extension and
+ * this interp are incompatible in their stubs mechanisms, and
+ * recorded the error in the oldest legacy place we have to do so.
+ */
+ Tcl_SetObjResult(target, Tcl_NewStringObj(iPtr->legacyResult, -1));
+ iPtr->legacyResult = NULL;
+ iPtr->legacyFreeProc = (void (*) (void))-1;
}
Tcl_TransferResult(target, code, interp);
goto done;