summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-06-21 21:30:53 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-06-21 21:30:53 (GMT)
commitbc87d9a2bc25805bbeda05983b9a403d0767fb1f (patch)
treed66a89aab2277d0b66eeef2bbb1639df7fd44cbe
parent7c2d72933f0d49aeac8e89082e833c41bda2b9f9 (diff)
downloadtcl-bc87d9a2bc25805bbeda05983b9a403d0767fb1f.zip
tcl-bc87d9a2bc25805bbeda05983b9a403d0767fb1f.tar.gz
tcl-bc87d9a2bc25805bbeda05983b9a403d0767fb1f.tar.bz2
Fix 3 "lset" testcases
-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. */