diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2013-02-04 14:40:40 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2013-02-04 14:40:40 (GMT) |
commit | 5537ab67eb915869ddd76bfbe1a7881c6faca15a (patch) | |
tree | 9f69275332c80280626c60becf9e973a7d69c4da /tests | |
parent | 586e53a4ac38b4a017a8be29a3832632ef62705a (diff) | |
parent | 5e82c1c3bc9f6e0222ba44ec737ef82ea07d6e5e (diff) | |
download | tcl-5537ab67eb915869ddd76bfbe1a7881c6faca15a.zip tcl-5537ab67eb915869ddd76bfbe1a7881c6faca15a.tar.gz tcl-5537ab67eb915869ddd76bfbe1a7881c6faca15a.tar.bz2 |
[3603163]: Stop crash in weird case where [eval] is used to make [array set]
get confused about whether there is a local variable table or not. Thanks to
Poor Yorick for identifying a reproducible crashing case.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/var.test | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/tests/var.test b/tests/var.test index ed7e930..5939100 100644 --- a/tests/var.test +++ b/tests/var.test @@ -793,6 +793,75 @@ test var-19.1 {crash when freeing locals hashtable: Bug 3037525} { foo ; # This crashes without the fix for the bug rename foo {} } {} + +test var-20.1 {array set compilation correctness: Bug 3603163} -setup { + unset -nocomplain x +} -body { + apply {{} { + global x + array set x {a 1} + }} + array size x +} -result 1 +test var-20.2 {array set compilation correctness: Bug 3603163} -setup { + unset -nocomplain x +} -body { + apply {{} { + global x + array set x {} + }} + array size x +} -result 0 +test var-20.3 {array set compilation correctness: Bug 3603163} -setup { + unset -nocomplain x +} -body { + apply {{} { + array set ::x {a 1} + }} + array size x +} -result 1 +test var-20.4 {array set compilation correctness: Bug 3603163} -setup { + unset -nocomplain x +} -body { + apply {{} { + array set ::x {} + }} + array size x +} -result 0 +test var-20.5 {array set compilation correctness: Bug 3603163} -setup { + unset -nocomplain x +} -body { + apply {{} { + global x + eval {array set x {a 1}} + }} + array size x +} -result 1 +test var-20.6 {array set compilation correctness: Bug 3603163} -setup { + unset -nocomplain x +} -body { + apply {{} { + global x + eval {array set x {}} + }} + array size x +} -result 0 +test var-20.7 {array set compilation correctness: Bug 3603163} -setup { + unset -nocomplain x +} -body { + apply {{} { + eval {array set ::x {a 1}} + }} + array size x +} -result 1 +test var-20.8 {array set compilation correctness: Bug 3603163} -setup { + unset -nocomplain x +} -body { + apply {{} { + eval {array set ::x {}} + }} + array size x +} -result 0 catch {namespace delete ns} catch {unset arr} |