diff options
| author | dkf <donal.k.fellows@manchester.ac.uk> | 2024-05-25 15:35:45 (GMT) |
|---|---|---|
| committer | dkf <donal.k.fellows@manchester.ac.uk> | 2024-05-25 15:35:45 (GMT) |
| commit | 845ff1ddf732887fc40128ce9ff980c5524b26d8 (patch) | |
| tree | 9ce2d5f2031c21da0c2e176fbbe195a26e743cda /generic/tclInterp.c | |
| parent | db2ea548def3585a73e7b0c98582e68dab510a09 (diff) | |
| parent | 3e56737166b9ae9be21274b4ff4c0318b19ff1a3 (diff) | |
| download | tcl-845ff1ddf732887fc40128ce9ff980c5524b26d8.zip tcl-845ff1ddf732887fc40128ce9ff980c5524b26d8.tar.gz tcl-845ff1ddf732887fc40128ce9ff980c5524b26d8.tar.bz2 | |
merge core-8-6-branch
Diffstat (limited to 'generic/tclInterp.c')
| -rw-r--r-- | generic/tclInterp.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/generic/tclInterp.c b/generic/tclInterp.c index a98216c..628412a 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -2904,6 +2904,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. @@ -2922,6 +2934,7 @@ ChildEval( result = Tcl_EvalObjEx(childInterp, objPtr, 0); Tcl_DecrRefCount(objPtr); } + done: Tcl_TransferResult(childInterp, result, interp); Tcl_Release(childInterp); |
