summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmdsGR.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2016-03-27 16:37:11 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2016-03-27 16:37:11 (GMT)
commit365eefedf170cdc365c5d948509ffb6d12b5ce23 (patch)
tree2a979d92014a91288560d7d033fb722bb3e606b8 /generic/tclCompCmdsGR.c
parentb8cacee84f43fc8f72c924e0c0fcc7c2f53f5a04 (diff)
downloadtcl-365eefedf170cdc365c5d948509ffb6d12b5ce23.zip
tcl-365eefedf170cdc365c5d948509ffb6d12b5ce23.tar.gz
tcl-365eefedf170cdc365c5d948509ffb6d12b5ce23.tar.bz2
[47ac84309b] Fix problems with [lreplace] compilation.
Diffstat (limited to 'generic/tclCompCmdsGR.c')
-rw-r--r--generic/tclCompCmdsGR.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c
index 87ed745..9f430ea 100644
--- a/generic/tclCompCmdsGR.c
+++ b/generic/tclCompCmdsGR.c
@@ -1488,8 +1488,18 @@ TclCompileLreplaceCmd(
return TCL_ERROR;
}
- if(idx2 != INDEX_END && idx2 >= 0 && idx2 < idx1) {
- idx2 = idx1-1;
+ /*
+ * Compilation fails when one index is end-based but the other isn't.
+ * Fixing this will require more bytecodes, but this is a workaround for
+ * now. [Bug 47ac84309b]
+ */
+
+ if ((idx1 <= INDEX_END) != (idx2 <= INDEX_END)) {
+ return TCL_ERROR;
+ }
+
+ if (idx2 != INDEX_END && idx2 >= 0 && idx2 < idx1) {
+ idx2 = idx1 - 1;
}
/*