summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-06-13 20:50:01 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-06-13 20:50:01 (GMT)
commit002a3c5b5f588d316c435c2b11bd489d62fac58d (patch)
tree92a12852b62f6fb0809dad6a93a47148c14a50a6
parentbf1528403276733a85426e74357783d937c7faed (diff)
parent8a5330377a4d514f7165b65577034d293aa5d520 (diff)
downloadtcl-002a3c5b5f588d316c435c2b11bd489d62fac58d.zip
tcl-002a3c5b5f588d316c435c2b11bd489d62fac58d.tar.gz
tcl-002a3c5b5f588d316c435c2b11bd489d62fac58d.tar.bz2
Merge 8.7. Eliminate warning, seen with clang
-rw-r--r--generic/tclBasic.c2
-rw-r--r--generic/tclCompile.c2
-rw-r--r--tests/listObj.test10
3 files changed, 12 insertions, 2 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 1d4b686..ea7726b 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -5197,7 +5197,7 @@ TclEvalEx(
wordStart = tokenPtr->start;
lines[objectsUsed] = TclWordKnownAtCompileTime(tokenPtr, NULL)
- ? wordLine : TCL_INDEX_NONE;
+ ? (int)wordLine : -1;
if (eeFramePtr->type == TCL_LOCATION_SOURCE) {
iPtr->evalFlags |= TCL_EVAL_FILE;
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 56b6857..5bfad37 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -3330,7 +3330,7 @@ EnterCmdWordData(
/* See Ticket 4b61afd660 */
wwlines[wordIdx] =
((wordIdx == 0) || TclWordKnownAtCompileTime(tokenPtr, NULL))
- ? wordLine : TCL_INDEX_NONE;
+ ? (int)wordLine : -1;
ePtr->line[wordIdx] = wordLine;
ePtr->next[wordIdx] = wordNext;
last = tokenPtr->start;
diff --git a/tests/listObj.test b/tests/listObj.test
index f17f085..0b64635 100644
--- a/tests/listObj.test
+++ b/tests/listObj.test
@@ -195,6 +195,16 @@ test listobj-10.1 {Bug [2971669]} {*}{
}
-result {{a b c d e} {} {a b c d e f}}
}
+test listobj-10.2 {Tcl_ListObjReplace with negative start value} testobj {
+ testlistobj set 1 a b c d e
+ testlistobj replace 1 -1 2 f
+ testlistobj get 1
+} {f c d e}
+test listobj-10.3 {Tcl_ListObjReplace with negative count value} testobj {
+ testlistobj set 1 a b c d e
+ testlistobj replace 1 1 -1 f
+ testlistobj get 1
+} {a f b c d e}
test listobj-11.1 {Bug 3598580: Tcl_ListObjReplace refcount management} testobj {
testobj bug3598580