summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2020-09-02 20:50:43 (GMT)
committerdgp <dgp@users.sourceforge.net>2020-09-02 20:50:43 (GMT)
commit9f309d56cc2544def77f3c913d28aa1c1f8e2e14 (patch)
treed62c6081871ce66bcd04c168e5c8e1666201b034
parent712f88bef73db43ea3e8169d8c5609ec420b3bf2 (diff)
downloadtcl-9f309d56cc2544def77f3c913d28aa1c1f8e2e14.zip
tcl-9f309d56cc2544def77f3c913d28aa1c1f8e2e14.tar.gz
tcl-9f309d56cc2544def77f3c913d28aa1c1f8e2e14.tar.bz2
Tests string-12.2[45].* and fixes to INST_STRING_RANGE.
-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