summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclListObj.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index d3e4f02..0fd489c 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -2871,6 +2871,9 @@ TclLsetFlat(
}
indexArray++;
+ if ((index == INT_MAX) && (elemCount == 0)) {
+ index = 0;
+ }
if (index < 0 || index > elemCount
|| (valueObj == NULL && index >= elemCount)) {
/* ...the index points outside the sublist. */