diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2006-12-11 00:48:06 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2006-12-11 00:48:06 +0000 |
commit | 718a7425915fd79f2939210d3d2e5741c7fc47e1 (patch) | |
tree | 7bad6e3ac50a724c8641f6276ef85cdc01596142 /t/comp | |
parent | a1cac82e623c5bbb331e6465011c5b46dfbfc277 (diff) | |
download | perl-718a7425915fd79f2939210d3d2e5741c7fc47e1.tar.gz |
fix eval qw(BEGIN{die}) style leaks (second attempt).
Repeat of change #28319 (backed out by change #28720), this time
freeing ops using the right pad. Also backs out the remempad
parser addition from change #29501; instead a new auxiliary
paser stack is added, which records the current value of
PL_comppad for every state.
p4raw-link: @29501 on //depot/perl: 2af555bf3f2b3ca8e114df3f5f680d40bd24d6bf
p4raw-link: @28720 on //depot/perl: c86b7e916b443ee192c5638ad9d077ad4e244713
p4raw-link: @28319 on //depot/perl: eb7d7d25d2f780edcbedc124a5bdca0d53ad8687
p4raw-id: //depot/perl@29504
Diffstat (limited to 't/comp')
-rw-r--r-- | t/comp/parser.t | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/t/comp/parser.t b/t/comp/parser.t index 55c645987f..ddbb7608e6 100644 --- a/t/comp/parser.t +++ b/t/comp/parser.t @@ -9,7 +9,7 @@ BEGIN { } BEGIN { require "./test.pl"; } -plan( tests => 62 ); +plan( tests => 65 ); eval '%@x=0;'; like( $@, qr/^Can't modify hash dereference in repeat \(x\)/, '%@x=0' ); @@ -211,7 +211,7 @@ like( $@, qr/Assignment to both a list and a scalar/, 'Assignment to both a list eval q{ s/x/#/e }; is( $@, '', 'comments in s///e' ); -# these two used to coredump because the op cleanup on parse error could +# these five used to coredump because the op cleanup on parse error could # be to the wrong pad eval q[ @@ -227,3 +227,27 @@ eval q[ ]; like($@, qr/Missing right curly/, 'nested sub syntax error 2' ); +eval q[ + sub { our $a= 1;$a;$a;$a;$a;$a;$a;$a;$a;$a;$a;$a;$a;$a;$a;$a;$a;$a;$a;$a; + use DieDieDie; +]; + +like($@, qr/Can't locate DieDieDie.pm/, 'croak cleanup' ); + +eval q[ + sub { my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m,$n,$o,$p,$q,$r,$s,$r); + use DieDieDie; +]; + +like($@, qr/Can't locate DieDieDie.pm/, 'croak cleanup 2' ); + + +eval q[ + my @a; + my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m,$n,$o,$p,$q,$r,$s,$r); + @a =~ s/a/b/; # compile-time error + use DieDieDie; +]; + +like($@, qr/Can't modify/, 'croak cleanup 3' ); + |