diff options
author | griffin <briang42@easystreet.net> | 2022-09-25 18:05:53 (GMT) |
---|---|---|
committer | griffin <briang42@easystreet.net> | 2022-09-25 18:05:53 (GMT) |
commit | dda585be8bc4eb50870c491eb7cd1b29eb42cef1 (patch) | |
tree | 1abff6b5ce31379bdba55f5206736a08d90a1e50 /tests | |
parent | 33195f9318b46186be7801d1a05bfee3f03c529b (diff) | |
download | tcl-dda585be8bc4eb50870c491eb7cd1b29eb42cef1.zip tcl-dda585be8bc4eb50870c491eb7cd1b29eb42cef1.tar.gz tcl-dda585be8bc4eb50870c491eb7cd1b29eb42cef1.tar.bz2 |
Fix out-of-bounds length bug.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lseq.test | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/lseq.test b/tests/lseq.test index ffb8a94..e05b32d 100644 --- a/tests/lseq.test +++ b/tests/lseq.test @@ -472,6 +472,25 @@ test lseq-4.3 {TIP examples} { set res } {{10 9 8 7 6 5 4 3 2 1} {1 2 3 4 5 6 7 8 9 10} {} {10 8 6 4 2} {5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0} {5.0 10.0 15.0 20.0 25.0} {} {25.0 20.0 15.0 10.0 5.0} {1 3 5 7 9} {25.0 20.0 15.0 10.0 5.0 0.0 -5.0 -10.0 -15.0 -20.0 -25.0} 5 5 5} +# +# Ticket 9933cc4d88697f05976accebd31c1e3ba6efe9c6 - lseq corner case +test lseq-4.4 {lseq corner case} -body { + set tcmd { + set res {} + set s [catch {lindex [lseq 10 100] 0} e] + lappend res $s $e + set s [catch {lindex [lseq 10 9223372036854775000] 0} e] + lappend res $s $e + set s [catch {llength [lseq 10 9223372036854775000]} e] + lappend res $s $e + set s [catch {lindex [lseq 10 2147483647] 0} e] + lappend res $s $e + set s [catch {llength [lseq 10 2147483647]} e] + lappend res $s $e + } + eval $tcmd +} -result {0 10 1 {max length of a Tcl list exceeded} 1 {max length of a Tcl list exceeded} 0 10 0 2147483638} + # cleanup ::tcltest::cleanupTests |