summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 5143391289..a35d600530 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2203,6 +2203,7 @@ PP(pp_goto)
}
/* First do some returnish stuff. */
+ SvREFCNT_inc(cv); /* avoid premature free during unwind */
FREETMPS;
cxix = dopoptosub(cxstack_ix);
if (cxix < 0)
@@ -2250,6 +2251,7 @@ PP(pp_goto)
/* Now do some callish stuff. */
SAVETMPS;
+ SAVEFREESV(cv); /* later, undo the 'avoid premature free' hack */
if (CvXSUB(cv)) {
#ifdef PERL_XSUB_OLDSTYLE
if (CvOLDSTYLE(cv)) {