diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-11-28 22:42:57 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-12-05 21:31:40 -0800 |
commit | 55b37f1c313121c8cbb341aceea93a386169d6fd (patch) | |
tree | 06ce0a27e9dcb996de3150a7c49cbf17c553eb61 /pp_ctl.c | |
parent | 7d7d93ad5efb66d5764017a7a62c90f3b5353986 (diff) | |
download | perl-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); } } |