summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclExecute.c12
-rw-r--r--tests/string.test14
2 files changed, 24 insertions, 2 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 890ce08..3d39e89 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -5347,13 +5347,21 @@ TEBCresume(
TRACE(("\"%.20s\" %.20s %.20s =>",
O2S(OBJ_AT_DEPTH(2)), O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS)));
length = Tcl_GetCharLength(OBJ_AT_DEPTH(2)) - 1;
+
+ DECACHE_STACK_INFO();
if (TclGetIntForIndexM(interp, OBJ_UNDER_TOS, length,
- &fromIdx) != TCL_OK
- || TclGetIntForIndexM(interp, OBJ_AT_TOS, length,
+ &fromIdx) != TCL_OK) {
+ CACHE_STACK_INFO();
+ TRACE_ERROR(interp);
+ goto gotError;
+ }
+ if (TclGetIntForIndexM(interp, OBJ_AT_TOS, length,
&toIdx) != TCL_OK) {
+ CACHE_STACK_INFO();
TRACE_ERROR(interp);
goto gotError;
}
+ CACHE_STACK_INFO();
if (fromIdx < 0) {
fromIdx = 0;
diff --git a/tests/string.test b/tests/string.test
index e42da8e..ba0780a 100644
--- a/tests/string.test
+++ b/tests/string.test
@@ -1506,6 +1506,20 @@ test string-12.22.$noComp {string range, shimmering binary/index} {
test string-12.23.$noComp {string range, surrogates, bug [11ae2be95dac9417]} utf16 {
run {list [string range a\U100000b 1 1] [string range a\U100000b 2 2] [string range a\U100000b 3 3]}
} [list \U100000 {} b]
+test string-12.24.$noComp {bignum index arithmetic} -setup {
+ proc demo {i j} {string range fubar $i $j}
+} -cleanup {
+ rename demo {}
+} -body {
+ demo 2 0+0x10000000000000000
+} -result bar
+test string-12.25.$noComp {bignum index arithmetic} -setup {
+ proc demo {i j} {string range fubar $i $j}
+} -cleanup {
+ rename demo {}
+} -body {
+ demo 0x10000000000000000-0xffffffffffffffff 3
+} -result uba
test string-13.1.$noComp {string repeat} {
list [catch {run {string repeat}} msg] $msg