From: Rafael Garcia-Suarez Date: Wed, 18 Sep 2002 22:14:57 +0000 (+0200) Subject: Re: Advice on coredump X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2f647fb2ca495f131b655d676cce3e88a9090ef9;p=p5sagit%2Fp5-mst-13.2.git Re: Advice on coredump Message-Id: <20020918221457.16cb1b43.rgarciasuarez@free.fr> p4raw-id: //depot/perl@17923 --- diff --git a/op.c b/op.c index a3876c4..67aeab0 100644 --- a/op.c +++ b/op.c @@ -4393,7 +4393,7 @@ Perl_cv_undef(pTHX_ CV *cv) AV *padlist = CvPADLIST(cv); I32 ix; /* pads may be cleared out already during global destruction */ - if (is_eval && !PL_dirty) { + if ((is_eval && !PL_dirty) || CvSPECIAL(cv)) { /* inner references to eval's cv must be fixed up */ AV *comppad_name = (AV*)AvARRAY(padlist)[0]; AV *comppad = (AV*)AvARRAY(padlist)[1]; diff --git a/t/op/closure.t b/t/op/closure.t index 09df7c1..99c3216 100755 --- a/t/op/closure.t +++ b/t/op/closure.t @@ -13,7 +13,7 @@ BEGIN { use Config; -print "1..171\n"; +print "1..172\n"; my $test = 1; sub test (&) { @@ -510,3 +510,7 @@ END } +# The following dumps core with perl <= 5.8.0 +BEGIN { $vanishing_pad = sub { eval $_[0] } } +$some_var = 123; +test { $vanishing_pad->( '$some_var' ) == 123 };