From: Vincent Pit Date: Thu, 18 Jun 2009 15:41:20 +0000 (+0200) Subject: Reset the original pp whenever possible in pp_rv2xv X-Git-Tag: v0.03~10 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=337a1b18d78b1f8abc831159aadb8a0ff42baf68;p=perl%2Fmodules%2Fautovivification.git Reset the original pp whenever possible in pp_rv2xv --- diff --git a/autovivification.xs b/autovivification.xs index a237759..8933e7a 100644 --- a/autovivification.xs +++ b/autovivification.xs @@ -272,7 +272,9 @@ STATIC OP *a_pp_rv2av(pTHX) { a_map_fetch(PL_op, &oi); - if (PL_op != oi.root && !SvOK(TOPs)) { + if (PL_op == oi.root) { /* This means "@$arrayref" */ + PL_op->op_ppaddr = oi.old_pp; + } else if (!SvOK(TOPs)) { /* We always need to push an empty array to fool the pp_aelem() that comes * later. */ SV *av; @@ -294,7 +296,9 @@ STATIC OP *a_pp_rv2hv(pTHX) { a_map_fetch(PL_op, &oi); - if (PL_op != oi.root && !SvOK(TOPs)) { + if (PL_op == oi.root) { /* This means "%$hashref" */ + PL_op->op_ppaddr = oi.old_pp; + } else if (!SvOK(TOPs)) { if (oi.root->op_flags & OPf_MOD) { SV *hv; POPs;