summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-03-01 16:40:05 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-03-01 16:40:05 (GMT)
commit22557045ac8877ad5bc11249c371d01baf4907ba (patch)
tree23bd9dcf8445190faa7306afc1f07c78884c31f9
parentdc43669d30a56f8cbe43beb718b0da3768ea7db4 (diff)
downloadtcl-22557045ac8877ad5bc11249c371d01baf4907ba.zip
tcl-22557045ac8877ad5bc11249c371d01baf4907ba.tar.gz
tcl-22557045ac8877ad5bc11249c371d01baf4907ba.tar.bz2
Add test for memleak
-rw-r--r--tests/var.test28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/var.test b/tests/var.test
index 0531746..b6b09fd 100644
--- a/tests/var.test
+++ b/tests/var.test
@@ -921,6 +921,34 @@ test var-22.0 {leak in array element unset: Bug a3309d01db} -setup {
rename getbytes {}
rename doit {}
} -result 0
+test var-22.1 {leak in localVarName intrep: Bug 80304238ac} -setup {
+ proc getbytes {} {
+ lindex [split [memory info] \n] 3 3
+ }
+ proc doit {} {
+ interp create slave
+ slave eval {
+ proc doit script {
+ eval $script
+ set foo bar
+ }
+ doit {foreach foo baz {}}
+ }
+ interp delete slave
+ }
+} -constraints memory -body {
+ set end [getbytes]
+ for {set i 0} {$i < 5} {incr i} {
+ doit
+ set tmp $end
+ set end [getbytes]
+ }
+ set leakedBytes [expr {$end - $tmp}]
+} -cleanup {
+ array unset A
+ rename getbytes {}
+ rename doit {}
+} -result 0
catch {namespace delete ns}