summaryrefslogtreecommitdiff
path: root/pad.c
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
commit01773faa9769567ce88d77c5c19bfde6b32b5488 (patch)
treea114b64e0f4f4d7e56a2c6c5b4ffff6e085206a3 /pad.c
parentc0c50798904ed219d069da8d28f789f4cc6e4fb2 (diff)
downloadperl-01773faa9769567ce88d77c5c19bfde6b32b5488.tar.gz
fix coredump in /(?{sub{}})/
p4raw-id: //depot/perl@22445
Diffstat (limited to 'pad.c')
-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)
{