diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-10 15:47:28 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-10 15:47:28 (GMT) |
commit | cad30557e2355c12398782e9a39b4ebdecb3f5d5 (patch) | |
tree | ed8c7208b27df21eb1bbe8873654a914305bd663 /generic/tclInterp.c | |
parent | b930863d81a04fae5e0e87303762437ce92b585a (diff) | |
parent | 0b39585b19e94e663d35f0618c748abfb37de5cd (diff) | |
download | tcl-cad30557e2355c12398782e9a39b4ebdecb3f5d5.zip tcl-cad30557e2355c12398782e9a39b4ebdecb3f5d5.tar.gz tcl-cad30557e2355c12398782e9a39b4ebdecb3f5d5.tar.bz2 |
Revert previous commit (doesn't work) and merge 9.0
Diffstat (limited to 'generic/tclInterp.c')
-rw-r--r-- | generic/tclInterp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 90f1575..b816c3e 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -2995,7 +2995,7 @@ ChildRecursionLimit( Tcl_Obj *const objv[]) /* Argument strings. */ { Interp *iPtr; - int limit; + Tcl_WideInt limit; if (objc) { if (Tcl_IsSafe(interp)) { @@ -3005,19 +3005,19 @@ ChildRecursionLimit( NULL); return TCL_ERROR; } - if (TclGetIntFromObj(interp, objv[0], &limit) == TCL_ERROR) { + if (TclGetWideIntFromObj(interp, objv[0], &limit) == TCL_ERROR) { return TCL_ERROR; } - if (limit <= 0) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "recursion limit must be > 0", -1)); + if (limit <= 0 || (size_t)limit >= ((Tcl_WideUInt)WIDE_MAX & TCL_INDEX_NONE)) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "recursion limit must be > 0 and < %" TCL_LL_MODIFIER "u", (Tcl_WideUInt)WIDE_MAX & TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "BADLIMIT", NULL); return TCL_ERROR; } Tcl_SetRecursionLimit(childInterp, limit); iPtr = (Interp *) childInterp; - if (interp == childInterp && iPtr->numLevels > limit) { + if (interp == childInterp && iPtr->numLevels > (size_t)limit) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "falling back due to new recursion limit", -1)); Tcl_SetErrorCode(interp, "TCL", "RECURSION", NULL); |