summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/Number.38
-rw-r--r--generic/tclExecute.c2
-rw-r--r--tests/lseq.test10
3 files changed, 15 insertions, 5 deletions
diff --git a/doc/Number.3 b/doc/Number.3
index 588171e..65a1332 100644
--- a/doc/Number.3
+++ b/doc/Number.3
@@ -74,10 +74,10 @@ in \fIinterp\fR.
If the examined value is recognized as a number, both routines return
\fBTCL_OK\fR, and use the pointer arguments \fIclientDataPtr\fR
and \fItypePtr\fR (which may not be NULL) to report information the
-caller can use to retrieve the numeric representation. In all cases,
-both routines write to *\fIclientDataPtr\fR a pointer to the internal
-storage location where Tcl holds the numeric value. When that
-internal storage is of type \fBdouble\fR
+caller can use to retrieve the numeric representation. Both routines
+write to *\fIclientDataPtr\fR a pointer to the internal storage location
+where Tcl holds the converted numeric value. When that internal storage
+is of type \fBdouble\fR
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index ab91919..619df83 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -4938,7 +4938,7 @@ TEBCresume(
/* Decode end-offset index values. */
- index = TclIndexDecode(opnd, length);
+ index = TclIndexDecode(opnd, length-1);
/* Compute value @ index */
if (index >= 0 && index < length) {
diff --git a/tests/lseq.test b/tests/lseq.test
index e05b32d..518a7bb 100644
--- a/tests/lseq.test
+++ b/tests/lseq.test
@@ -489,9 +489,19 @@ test lseq-4.4 {lseq corner case} -body {
lappend res $s $e
}
eval $tcmd
+} -cleanup {
+ unset res
} -result {0 10 1 {max length of a Tcl list exceeded} 1 {max length of a Tcl list exceeded} 0 10 0 2147483638}
+# Ticket 99e834bf33 - lseq, lindex end off by one
+
+test lseq-4.5 {lindex off by one} -body {
+ lappend res [eval {lindex [lseq 1 4] end}]
+ lappend res [eval {lindex [lseq 1 4] end-1}]
+} -result {4 3}
+
+
# cleanup
::tcltest::cleanupTests
return