projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5c41a5f
)
add test for change 22209 (Remove small memory leak in newATTRSUB)
author
Dave Mitchell
<davem@fdisolutions.com>
Sun, 25 Jan 2004 12:00:04 +0000
(12:00 +0000)
committer
Dave Mitchell
<davem@fdisolutions.com>
Sun, 25 Jan 2004 12:00:04 +0000
(12:00 +0000)
p4raw-id: //depot/perl@22215
t/op/closure.t
patch
|
blob
|
history
diff --git
a/t/op/closure.t
b/t/op/closure.t
index
f9da311
..
4d560f6
100755
(executable)
--- a/
t/op/closure.t
+++ b/
t/op/closure.t
@@
-13,7
+13,7
@@
BEGIN {
use Config;
-print "1..18
6
\n";
+print "1..18
7
\n";
my $test = 1;
sub test (&) {
@@
-678,6
+678,23
@@
__EOF__
test { $got eq 'ok' };
}
+# After newsub is redefined outside the BEGIN, it's CvOUTSIDE should point
+# to main rather than BEGIN, and BEGIN should be freed.
+
+{
+ my $flag = 0;
+ sub X::DESTROY { $flag = 1 }
+ {
+ my $x;
+ BEGIN {$x = \&newsub }
+ sub newsub {};
+ $x = bless {}, 'X';
+ }
+ test { $flag == 1 };
+}
+
+
+