summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-11-28 22:42:57 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-12-05 21:31:40 -0800
commit55b37f1c313121c8cbb341aceea93a386169d6fd (patch)
tree06ce0a27e9dcb996de3150a7c49cbf17c553eb61 /pp_ctl.c
parent7d7d93ad5efb66d5764017a7a62c90f3b5353986 (diff)
downloadperl-55b37f1c313121c8cbb341aceea93a386169d6fd.tar.gz
pp_goto: Call get-magic before choosing goto type
Deciding whether this is goto-label or goto-sub can only correctly happen after get-magic has been invoked, as get-magic can cause the argument to begin or cease to be a subroutine reference.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index f889ca8aba..0256070056 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2768,6 +2768,7 @@ PP(pp_goto)
if (PL_op->op_flags & OPf_STACKED) {
SV * const sv = POPs;
+ SvGETMAGIC(sv);
/* This egregious kludge implements goto &subroutine */
if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PVCV) {
@@ -2951,7 +2952,7 @@ PP(pp_goto)
}
}
else {
- label = SvPV_const(sv, label_len);
+ label = SvPV_nomg_const(sv, label_len);
label_flags = SvUTF8(sv);
}
}