diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-15 15:07:44 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-15 15:07:44 (GMT) |
commit | 5758c119f8180b9f3f902d157e567a1c2a7f85e0 (patch) | |
tree | 3fb58de64c9cbd8d1b798a9ac37d604dacbde8c3 /generic/tclExecute.c | |
parent | 39aec08fb0bcd5aa7d51f44c3b79e21d8de33744 (diff) | |
parent | 245a63f4919420ca6a36f14ba0866a91b51494b8 (diff) | |
download | tcl-5758c119f8180b9f3f902d157e567a1c2a7f85e0.zip tcl-5758c119f8180b9f3f902d157e567a1c2a7f85e0.tar.gz tcl-5758c119f8180b9f3f902d157e567a1c2a7f85e0.tar.bz2 |
Merge 8.7
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 875601e..e3512ef 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -4653,13 +4653,19 @@ TEBCresume( */ if ((TclListObjGetElements(interp, valuePtr, &objc, &objv) == TCL_OK) - && !TclHasIntRep(value2Ptr, &tclListType) - && (TclGetIntForIndexM(NULL, value2Ptr, objc-1, - &index) == TCL_OK)) { - TclDecrRefCount(value2Ptr); - tosPtr--; - pcAdjustment = 1; - goto lindexFastPath; + && !TclHasIntRep(value2Ptr, &tclListType)) { + int code; + + DECACHE_STACK_INFO(); + code = TclGetIntForIndexM(interp, value2Ptr, objc-1, &index); + CACHE_STACK_INFO(); + if (code == TCL_OK) { + TclDecrRefCount(value2Ptr); + tosPtr--; + pcAdjustment = 1; + goto lindexFastPath; + } + Tcl_ResetResult(interp); } objResultPtr = TclLindexList(interp, valuePtr, value2Ptr); @@ -5094,10 +5100,13 @@ TEBCresume( */ slength = Tcl_GetCharLength(valuePtr); + DECACHE_STACK_INFO(); if (TclGetIntForIndexM(interp, value2Ptr, slength-1, &index)!=TCL_OK) { + CACHE_STACK_INFO(); TRACE_ERROR(interp); goto gotError; } + CACHE_STACK_INFO(); if (index >= slength) { TclNewObj(objResultPtr); @@ -5134,13 +5143,21 @@ TEBCresume( TRACE(("\"%.20s\" %.20s %.20s =>", O2S(OBJ_AT_DEPTH(2)), O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS))); slength = Tcl_GetCharLength(OBJ_AT_DEPTH(2)) - 1; + + DECACHE_STACK_INFO(); if (TclGetIntForIndexM(interp, OBJ_UNDER_TOS, slength, - &fromIdx) != TCL_OK - || TclGetIntForIndexM(interp, OBJ_AT_TOS, slength, + &fromIdx) != TCL_OK) { + CACHE_STACK_INFO(); + TRACE_ERROR(interp); + goto gotError; + } + if (TclGetIntForIndexM(interp, OBJ_AT_TOS, slength, &toIdx) != TCL_OK) { + CACHE_STACK_INFO(); TRACE_ERROR(interp); goto gotError; } + CACHE_STACK_INFO(); if (fromIdx == TCL_INDEX_NONE) { fromIdx = TCL_INDEX_START; @@ -5223,14 +5240,17 @@ TEBCresume( slength = Tcl_GetCharLength(valuePtr) - 1; TRACE(("\"%.20s\" %s %s \"%.20s\" => ", O2S(valuePtr), O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS), O2S(value3Ptr))); + DECACHE_STACK_INFO(); if (TclGetIntForIndexM(interp, OBJ_UNDER_TOS, slength, &fromIdx) != TCL_OK || TclGetIntForIndexM(interp, OBJ_AT_TOS, slength, &toIdx) != TCL_OK) { + CACHE_STACK_INFO(); TclDecrRefCount(value3Ptr); TRACE_ERROR(interp); goto gotError; } + CACHE_STACK_INFO(); TclDecrRefCount(OBJ_AT_TOS); (void) POP_OBJECT(); TclDecrRefCount(OBJ_AT_TOS); |