summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2004-03-06 15:25:32 +0000
committerDave Mitchell <davem@fdisolutions.com>2004-03-06 15:25:32 +0000
commit11e77146d62cd4d19d8f5a4858c3f63305da9e4f (patch)
treea114b64e0f4f4d7e56a2c6c5b4ffff6e085206a3
parent221e20899fabd0af8f8fae9b8c89101305898139 (diff)
downloadperl-11e77146d62cd4d19d8f5a4858c3f63305da9e4f.tar.gz
fix coredump in /(?{sub{}})/
p4raw-id: //depot/perl@22445
-rw-r--r--pad.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pad.c b/pad.c
index 316833d6b0..f2c77771d8 100644
--- a/pad.c
+++ b/pad.c
@@ -257,8 +257,11 @@ Perl_pad_undef(pTHX_ CV* cv)
CV *innercv = (CV*)curpad[ix];
namepad[ix] = Nullsv;
SvREFCNT_dec(namesv);
- curpad[ix] = Nullsv;
- SvREFCNT_dec(innercv);
+
+ if (SvREFCNT(comppad) < 2) { /* allow for /(?{ sub{} })/ */
+ curpad[ix] = Nullsv;
+ SvREFCNT_dec(innercv);
+ }
if (SvREFCNT(innercv) /* in use, not just a prototype */
&& CvOUTSIDE(innercv) == cv)
{