diff options
| author | aspect+tclcore@abstracted-spleen.org <aspect> | 2015-02-19 02:34:43 (GMT) |
|---|---|---|
| committer | aspect+tclcore@abstracted-spleen.org <aspect> | 2015-02-19 02:34:43 (GMT) |
| commit | 320102f3cdac04af48163e20c5ad429f7904d0ea (patch) | |
| tree | 437c7f1136cd39ced0be486e6e9ada7d6ee63f26 /generic/tclCompCmdsGR.c | |
| parent | 786f98e95b9ee1ededba8059ada79618f6c64913 (diff) | |
| download | tcl-320102f3cdac04af48163e20c5ad429f7904d0ea.zip tcl-320102f3cdac04af48163e20c5ad429f7904d0ea.tar.gz tcl-320102f3cdac04af48163e20c5ad429f7904d0ea.tar.bz2 | |
(core ticket [32b6159246]) Fix for [lreplace l x y] where y<x-1
Diffstat (limited to 'generic/tclCompCmdsGR.c')
| -rw-r--r-- | generic/tclCompCmdsGR.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c index e2fb43d..5220576 100644 --- a/generic/tclCompCmdsGR.c +++ b/generic/tclCompCmdsGR.c @@ -1524,6 +1524,9 @@ TclCompileLreplaceCmd( tmpObj = Tcl_NewIntObj(idx1); Tcl_IncrRefCount(tmpObj); } + if(idx2 < idx1) { + idx2 = idx1-1; + } goto dropRange; } } @@ -1547,7 +1550,7 @@ TclCompileLreplaceCmd( idx1 = 0; goto replaceTail; } else { - if (idx1 > 0 && idx2 > 0 && idx2 < idx1) { + if (idx1 >= 0 && idx2 > 0 && idx2 < idx1) { idx2 = idx1 - 1; } else if (idx1 < 0 && idx2 < 0 && idx2 < idx1) { idx2 = idx1 - 1; |
