From 269c56a9698699f195e90fd7c25d82838befa8bb Mon Sep 17 00:00:00 2001 From: sebres Date: Mon, 27 May 2024 19:26:46 +0000 Subject: fix for [e3f4a8b78dec4bdb]: don't swallow limit errors in further invocations of EvalObjvCore (e. g. direct invocation or NRE, Tcl_EvalObjv, Tcl_EvalObjEx, TclNREvalObjEx, etc); partially reverts [b740e2abbd44c7d0] --- generic/tclBasic.c | 4 ++++ generic/tclInterp.c | 13 ------------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index c462278..b66c1cc 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -4330,6 +4330,10 @@ EvalObjvCore( } if (TclLimitExceeded(iPtr->limit)) { + /* generate error message if not yet already logged at this stage */ + if (!(iPtr->flags & ERR_ALREADY_LOGGED)) { + Tcl_LimitCheck(interp); + } return TCL_ERROR; } diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 2c0035c..ad06293 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -2795,18 +2795,6 @@ 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. @@ -2825,7 +2813,6 @@ ChildEval( result = Tcl_EvalObjEx(childInterp, objPtr, 0); Tcl_DecrRefCount(objPtr); } - done: Tcl_TransferResult(childInterp, result, interp); Tcl_Release(childInterp); -- cgit v0.12