summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2019-01-09 10:10:12 (GMT)
committersebres <sebres@users.sourceforge.net>2019-01-09 10:10:12 (GMT)
commit6504b376c3d1878dd2acb60c9ac6065a51305fed (patch)
treed7197c615f884da1b4579005a6967a6a7b0f7601
parent3b1d9efc79aa9331ecd4ce3f13fcdaeeb93f119b (diff)
parent4693981b235565c28349466192503fb764e5e55e (diff)
downloadtcl-6504b376c3d1878dd2acb60c9ac6065a51305fed.zip
tcl-6504b376c3d1878dd2acb60c9ac6065a51305fed.tar.gz
tcl-6504b376c3d1878dd2acb60c9ac6065a51305fed.tar.bz2
merge 8.6 (regression bug-[cc1e91552c], etc)
-rw-r--r--generic/tclExecute.c8
-rw-r--r--tests/basic.test6
-rw-r--r--tests/chanio.test8
-rw-r--r--tests/io.test8
-rw-r--r--tests/lrange.test10
5 files changed, 34 insertions, 6 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 3651028..c8f09f5 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -4963,8 +4963,12 @@ TEBCresume(
/* Every range of an empty list is an empty list */
if (objc == 0) {
- TRACE_APPEND(("\n"));
- NEXT_INST_F(9, 0, 0);
+ /* avoid return of not canonical list (e. g. spaces in string repr.) */
+ if (ListObjIsCanonical(valuePtr)) {
+ TRACE_APPEND(("\n"));
+ NEXT_INST_F(9, 0, 0);
+ }
+ goto emptyList;
}
/* Decode index value operands. */
diff --git a/tests/basic.test b/tests/basic.test
index 2332994..1890042 100644
--- a/tests/basic.test
+++ b/tests/basic.test
@@ -958,6 +958,12 @@ test basic-48.23.$noComp {expansion: handle return codes} -constraints $constrai
unset res t
} -result {0 10 1 Hejsan}
+test basic-48.24.$noComp {expansion: empty not canonical list, regression test, bug [cc1e91552c]} -constraints $constraints -setup {
+ unset -nocomplain a
+} -body {
+ run {list [list {*}{ }] [list {*}[format %c 32]] [list {*}[set a { }]]}
+} -result [lrepeat 3 {}] -cleanup {unset -nocomplain a}
+
} ;# End of noComp loop
test basic-49.1 {Tcl_EvalEx: verify TCL_EVAL_GLOBAL operation} testevalex {
diff --git a/tests/chanio.test b/tests/chanio.test
index 300c54a..9dc9e7c 100644
--- a/tests/chanio.test
+++ b/tests/chanio.test
@@ -30,8 +30,11 @@ namespace eval ::tcl::test::io {
variable msg
variable expected
- loadTestedCommands
- catch [list package require -exact Tcltest [info patchlevel]]
+ catch {
+ ::tcltest::loadTestedCommands
+ package require -exact Tcltest [info patchlevel]
+ set ::tcltestlib [lindex [package ifneeded Tcltest [info patchlevel]] 1]
+ }
package require tcltests
testConstraint testbytestring [llength [info commands testbytestring]]
@@ -7446,6 +7449,7 @@ test chan-io-59.1 {Thread reference of channels} {testmainthread testchannel} {
test chan-io-60.1 {writing illegal utf sequences} {openpipe fileevent testbytestring} {
# This test will hang in older revisions of the core.
set out [open $path(script) w]
+ chan puts $out "catch {load $::tcltestlib Tcltest}"
chan puts $out {
chan puts [testbytestring \xe2]
exit 1
diff --git a/tests/io.test b/tests/io.test
index 683a1b2..d42f59e 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -29,8 +29,11 @@ namespace eval ::tcl::test::io {
variable msg
variable expected
- loadTestedCommands
- catch [list package require -exact Tcltest [info patchlevel]]
+ catch {
+ ::tcltest::loadTestedCommands
+ package require -exact Tcltest [info patchlevel]
+ set ::tcltestlib [lindex [package ifneeded Tcltest [info patchlevel]] 1]
+ }
package require tcltests
testConstraint testbytestring [llength [info commands testbytestring]]
@@ -8270,6 +8273,7 @@ test io-60.1 {writing illegal utf sequences} {openpipe fileevent testbytestring}
# This test will hang in older revisions of the core.
set out [open $path(script) w]
+ puts $out "catch {load $::tcltestlib Tcltest}"
puts $out {
puts [testbytestring \xe2]
exit 1
diff --git a/tests/lrange.test b/tests/lrange.test
index 3077d91..e12e1a4 100644
--- a/tests/lrange.test
+++ b/tests/lrange.test
@@ -107,6 +107,16 @@ test lrange-3.6 {compiled with calculated indices, end out of range (after end)}
list [lrange {a b c} 1 end+1] [lrange {a b c} 1+0 2+1] [lrange {a b c} 1 end+1] [lrange {a b c} end-1 3+1]
} [lrepeat 4 {b c}]
+test lrange-3.7a {compiled on empty not canonical list (with static and dynamic indices), regression test, bug [cc1e91552c]} {
+ list [lrange { } 0 1] [lrange [format %c 32] 0 1] [lrange [set a { }] 0 1] \
+ [lrange { } 0-1 end+1] [lrange [format %c 32] 0-1 end+1] [lrange $a 0-1 end+1]
+} [lrepeat 6 {}]
+test lrange-3.7b {not compiled on empty not canonical list (with static and dynamic indices), regression test, bug [cc1e91552c]} {
+ set cmd lrange
+ list [$cmd { } 0 1] [$cmd [format %c 32] 0 1] [$cmd [set a { }] 0 1] \
+ [$cmd { } 0-1 end+1] [$cmd [format %c 32] 0-1 end+1] [$cmd $a 0-1 end+1]
+} [lrepeat 6 {}]
+
test lrange-4.1 {lrange pure promise} -body {
set ll1 [list $tcl_version 2 3 4]
# Shared