diff options
Diffstat (limited to 'generic/tclInterp.c')
| -rw-r--r-- | generic/tclInterp.c | 54 |
1 files changed, 16 insertions, 38 deletions
diff --git a/generic/tclInterp.c b/generic/tclInterp.c index e38ec2b..70e1246 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -2842,18 +2842,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. @@ -2872,7 +2860,6 @@ ChildEval( result = Tcl_EvalObjEx(childInterp, objPtr, 0); Tcl_DecrRefCount(objPtr); } - done: Tcl_TransferResult(childInterp, result, interp); Tcl_Release(childInterp); @@ -4473,8 +4460,7 @@ ChildCommandLimitCmd( if (hPtr != NULL) { limitCBPtr = (ScriptLimitCallback *)Tcl_GetHashValue(hPtr); if (limitCBPtr != NULL && limitCBPtr->scriptObj != NULL) { - Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[0], -1), - limitCBPtr->scriptObj); + TclDictPut(NULL, dictPtr, options[0], limitCBPtr->scriptObj); } else { goto putEmptyCommandInDict; } @@ -4483,22 +4469,19 @@ ChildCommandLimitCmd( putEmptyCommandInDict: TclNewObj(empty); - Tcl_DictObjPut(NULL, dictPtr, - Tcl_NewStringObj(options[0], -1), empty); + TclDictPut(NULL, dictPtr, options[0], empty); } - Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[1], -1), - Tcl_NewWideIntObj(Tcl_LimitGetGranularity(childInterp, - TCL_LIMIT_COMMANDS))); + TclDictPut(NULL, dictPtr, options[1], Tcl_NewWideIntObj( + Tcl_LimitGetGranularity(childInterp, TCL_LIMIT_COMMANDS))); if (Tcl_LimitTypeEnabled(childInterp, TCL_LIMIT_COMMANDS)) { - Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[2], -1), - Tcl_NewWideIntObj(Tcl_LimitGetCommands(childInterp))); + TclDictPut(NULL, dictPtr, options[2], Tcl_NewWideIntObj( + Tcl_LimitGetCommands(childInterp))); } else { Tcl_Obj *empty; TclNewObj(empty); - Tcl_DictObjPut(NULL, dictPtr, - Tcl_NewStringObj(options[2], -1), empty); + TclDictPut(NULL, dictPtr, options[2], empty); } Tcl_SetObjResult(interp, dictPtr); return TCL_OK; @@ -4660,8 +4643,7 @@ ChildTimeLimitCmd( if (hPtr != NULL) { limitCBPtr = (ScriptLimitCallback *)Tcl_GetHashValue(hPtr); if (limitCBPtr != NULL && limitCBPtr->scriptObj != NULL) { - Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[0], -1), - limitCBPtr->scriptObj); + TclDictPut(NULL, dictPtr, options[0], limitCBPtr->scriptObj); } else { goto putEmptyCommandInDict; } @@ -4669,29 +4651,25 @@ ChildTimeLimitCmd( Tcl_Obj *empty; putEmptyCommandInDict: TclNewObj(empty); - Tcl_DictObjPut(NULL, dictPtr, - Tcl_NewStringObj(options[0], -1), empty); + TclDictPut(NULL, dictPtr, options[0], empty); } - Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[1], -1), - Tcl_NewWideIntObj(Tcl_LimitGetGranularity(childInterp, - TCL_LIMIT_TIME))); + TclDictPut(NULL, dictPtr, options[1], Tcl_NewWideIntObj( + Tcl_LimitGetGranularity(childInterp, TCL_LIMIT_TIME))); if (Tcl_LimitTypeEnabled(childInterp, TCL_LIMIT_TIME)) { Tcl_Time limitMoment; Tcl_LimitGetTime(childInterp, &limitMoment); - Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[2], -1), - Tcl_NewWideIntObj(limitMoment.usec/1000)); - Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[3], -1), + TclDictPut(NULL, dictPtr, options[2], + Tcl_NewWideIntObj(limitMoment.usec / 1000)); + TclDictPut(NULL, dictPtr, options[3], Tcl_NewWideIntObj(limitMoment.sec)); } else { Tcl_Obj *empty; TclNewObj(empty); - Tcl_DictObjPut(NULL, dictPtr, - Tcl_NewStringObj(options[2], -1), empty); - Tcl_DictObjPut(NULL, dictPtr, - Tcl_NewStringObj(options[3], -1), empty); + TclDictPut(NULL, dictPtr, options[2], empty); + TclDictPut(NULL, dictPtr, options[3], empty); } Tcl_SetObjResult(interp, dictPtr); return TCL_OK; |
