summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2013-06-05 07:19:02 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2013-06-05 07:19:02 (GMT)
commite2aebdd0bfef45036c0e1242c55efd86773ecca4 (patch)
tree9fd8c663b8cbd76efefec52f9614115721d587b0 /tests
parent63a81f0f749c1cc9965874146ba78f865ad5393a (diff)
downloadtcl-e2aebdd0bfef45036c0e1242c55efd86773ecca4.zip
tcl-e2aebdd0bfef45036c0e1242c55efd86773ecca4.tar.gz
tcl-e2aebdd0bfef45036c0e1242c55efd86773ecca4.tar.bz2
Stack cleanup works now even in the most evil expansion cases.
Diffstat (limited to 'tests')
-rw-r--r--tests/for.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/for.test b/tests/for.test
index cfba1fe..c5803ee 100644
--- a/tests/for.test
+++ b/tests/for.test
@@ -882,6 +882,36 @@ test for-7.4 {Bug 3614226: ensure that continue cleans up the expansion stack} m
expr {$end - $tmp}
}}
} 0
+test for-7.5 {Bug 3614226: ensure that break cleans up the expansion stack} memory {
+ apply {{} {
+ set l [lrepeat 50 p q r]
+ # Can't use [memtest]; must be careful when we change stack frames
+ set end [meminfo]
+ for {set i 0} {$i < 5} {incr i} {
+ for {set x 0} {[incr x]<50} {} {
+ puts [puts {*}$l {*}[puts a b c {*}$l {*}[break] d e f]]
+ }
+ set tmp $end
+ set end [meminfo]
+ }
+ expr {$end - $tmp}
+ }}
+} 0
+test for-7.6 {Bug 3614226: ensure that continue cleans up the expansion stack} memory {
+ apply {{} {
+ set l [lrepeat 50 p q r]
+ # Can't use [memtest]; must be careful when we change stack frames
+ set end [meminfo]
+ for {set i 0} {$i < 5} {incr i} {
+ for {set x 0} {[incr x]<50} {} {
+ puts [puts {*}$l {*}[puts a b c {*}$l {*}[continue] d e f]]
+ }
+ set tmp $end
+ set end [meminfo]
+ }
+ expr {$end - $tmp}
+ }}
+} 0
# cleanup
::tcltest::cleanupTests