summaryrefslogtreecommitdiffstats
path: root/generic/tclInterp.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2024-05-25 15:54:52 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2024-05-25 15:54:52 (GMT)
commit59c4ba8244fac7b314ddb19d65148095bffb10e1 (patch)
treef120752d1a6b7e61fca2f1c229fbe655cc0cc2d4 /generic/tclInterp.c
parent71b355c321bcb45f0f678dee68bef5c5232bc5bd (diff)
parent845ff1ddf732887fc40128ce9ff980c5524b26d8 (diff)
downloadtcl-59c4ba8244fac7b314ddb19d65148095bffb10e1.zip
tcl-59c4ba8244fac7b314ddb19d65148095bffb10e1.tar.gz
tcl-59c4ba8244fac7b314ddb19d65148095bffb10e1.tar.bz2
Merge 8.7
Diffstat (limited to 'generic/tclInterp.c')
-rw-r--r--generic/tclInterp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/generic/tclInterp.c b/generic/tclInterp.c
index 5fbefbf..e38ec2b 100644
--- a/generic/tclInterp.c
+++ b/generic/tclInterp.c
@@ -2842,6 +2842,18 @@ ChildEval(
Tcl_Preserve(childInterp);
Tcl_AllowExceptions(childInterp);
+ /*
+ * If we're transferring to another interpreter, check it's limits first.
+ * It's much more reliable to do that now rather than waiting for the
+ * intermittent checks done during running; the slight performance hit for
+ * a cross-interp call is not a big problem. [Bug e3f4a8b78d]
+ */
+
+ if (interp != childInterp && Tcl_LimitCheck(childInterp) != TCL_OK) {
+ result = TCL_ERROR;
+ goto done;
+ }
+
if (objc == 1) {
/*
* TIP #280: Make actual argument location available to eval'd script.
@@ -2860,6 +2872,7 @@ ChildEval(
result = Tcl_EvalObjEx(childInterp, objPtr, 0);
Tcl_DecrRefCount(objPtr);
}
+ done:
Tcl_TransferResult(childInterp, result, interp);
Tcl_Release(childInterp);