summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmdsGR.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2016-03-27 16:40:28 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2016-03-27 16:40:28 (GMT)
commit8f836376b750992af984de0f37c0804cf1e894dc (patch)
treee820611013a48ceb0a26d195e6145e79c77e74f6 /generic/tclCompCmdsGR.c
parent7dd80b018272fda52049b7bd9c35ee829439d15c (diff)
parent79e34ea63c86a40917630be738c7cf19da134ac7 (diff)
downloadtcl-8f836376b750992af984de0f37c0804cf1e894dc.zip
tcl-8f836376b750992af984de0f37c0804cf1e894dc.tar.gz
tcl-8f836376b750992af984de0f37c0804cf1e894dc.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;
}
/*