diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-09-22 23:47:11 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-09-22 23:47:11 -0700 |
commit | 8ed49485fa2d8dfdc87e0a7a269aa210d3e6da83 (patch) | |
tree | 70cac99691453f7a15305dea8f65a6fde679b037 /t | |
parent | 3c5d942fb372701fbc63076211d0fa17b8c2b6a2 (diff) | |
download | perl-8ed49485fa2d8dfdc87e0a7a269aa210d3e6da83.tar.gz |
[perl #70614] Seg. fault with eval/use/UNITCHECK/DESTROY/eval combination
This case can be reduced to:
eval "UNITCHECK{ eval 0 }"
(eval 0 triggers the bug more reliably than eval ''.)
The inner eval clobbers PL_eval_start, so when the UNITCHECK finishes,
the outer eval tries to call the inner eval’s code, which has been
freed already.
This commit saves PL_eval_start and restores it after UNITCHECK.
Diffstat (limited to 't')
-rw-r--r-- | t/op/blocks.t | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/t/op/blocks.t b/t/op/blocks.t index 476d9ea9af..717be4cdf2 100644 --- a/t/op/blocks.t +++ b/t/op/blocks.t @@ -6,7 +6,7 @@ BEGIN { require './test.pl'; } -plan tests => 3; +plan tests => 4; my @expect = qw( b1 @@ -105,3 +105,7 @@ sub CHECK {print ":check"} sub INIT {print ":init"} sub END {print ":end"} SCRIPT3 + +fresh_perl_is(<<'SCRIPT70614', "still here",{switches => [''], stdin => '', stderr => 1 },'eval-UNITCHECK-eval (bug 70614)'); +eval "UNITCHECK { eval 0 }"; print "still here"; +SCRIPT70614 |