]> git.vpit.fr Git - perl/modules/autovivification.git/blobdiff - autovivification.xs
Plain dereferencing shouldn't have a different behaviour
[perl/modules/autovivification.git] / autovivification.xs
index 9e10bb5a9f00dd089321c6646f5c54580dd35f88..c0ff27c00b878c689784945dcb42a3475fa1d3af 100644 (file)
@@ -274,7 +274,9 @@ STATIC OP *a_pp_rv2av(pTHX) {
  UV hint;
  dSP;
 
- if (!SvOK(TOPs)) {
+ a_map_fetch(PL_op, &oi);
+
+ if (PL_op != oi.root && !SvOK(TOPs)) {
   /* We always need to push an empty array to fool the pp_aelem() that comes
    * later. */
   SV *av;
@@ -284,8 +286,6 @@ STATIC OP *a_pp_rv2av(pTHX) {
   RETURN;
  }
 
- a_map_fetch(PL_op, &oi);
-
  return CALL_FPTR(oi.old_pp)(aTHX);
 }
 
@@ -298,7 +298,7 @@ STATIC OP *a_pp_rv2hv(pTHX) {
 
  a_map_fetch(PL_op, &oi);
 
- if (!SvOK(TOPs)) {
+ if (PL_op != oi.root && !SvOK(TOPs)) {
   if (oi.root->op_flags & OPf_MOD) {
    SV *hv;
    POPs;