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)
commit9b5987cf695225d4884be4f62c09568bca318408 (patch)
tree23bd9dcf8445190faa7306afc1f07c78884c31f9
parent618001362ea4c81a61a94835b50b0bc08576819a (diff)
downloadtcl-9b5987cf695225d4884be4f62c09568bca318408.zip
tcl-9b5987cf695225d4884be4f62c09568bca318408.tar.gz
tcl-9b5987cf695225d4884be4f62c09568bca318408.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}