From: Vincent Pit Date: Mon, 6 Jun 2016 08:52:26 +0000 (+0200) Subject: Actually restore old_cop in su_localize() X-Git-Tag: rt112246^2~6 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FScope-Upper.git;a=commitdiff_plain;h=ae64b29ad6c13002911b394f671bd4af07b3fc89 Actually restore old_cop in su_localize() --- diff --git a/Upper.xs b/Upper.xs index e810d69..386bf5a 100644 --- a/Upper.xs +++ b/Upper.xs @@ -900,13 +900,12 @@ static void su_localize(pTHX_ void *ud_) { if (SvTYPE(sv) >= SVt_PVGV) { gv = (GV *) sv; } else { - /* new perl context implementation frees savestack *before* restoring * PL_curcop. Temporarily restore it prematurely to make gv_fetch* * looks up unqualified var names in the caller's package */ #if SU_HAS_NEW_CXT COP *old_cop = PL_curcop; - PL_curcop = CX_CUR()->blk_oldcop; + PL_curcop = CX_CUR()->blk_oldcop; #endif #ifdef gv_fetchsv @@ -917,7 +916,7 @@ static void su_localize(pTHX_ void *ud_) { gv = gv_fetchpvn_flags(name, len, GV_ADDMULTI, t); #endif #if SU_HAS_NEW_CXT - CX_CUR()->blk_oldcop = PL_curcop; + CX_CUR()->blk_oldcop = old_cop; #endif }