summaryrefslogtreecommitdiff
path: root/pp.h
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2011-01-02 19:38:30 +0000
committerDavid Mitchell <davem@iabyn.com>2011-01-02 20:00:27 +0000
commit9426e1a55981168c83a030df9bce5e0b46586581 (patch)
tree9693090582930b7f145f2050c847bd2f87f9ed0d /pp.h
parentbff33ce02f3be5fbb5af2c3c92e9853aaa12151e (diff)
downloadperl-9426e1a55981168c83a030df9bce5e0b46586581.tar.gz
make <expr> always overload if expr is overloaded
Due to the way that '<> as glob' was parsed differently from '<> as filehandle' from 5.6 onwards, something like <$foo[0]> didn't handle overloading, even where $foo[0] was an overloaded object. This was contrary to the docs for overload, and meant that <> couldn't be used as a general overloaded iterator operator.
Diffstat (limited to 'pp.h')
-rw-r--r--pp.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/pp.h b/pp.h
index 5ba9ae2109..4d0395314a 100644
--- a/pp.h
+++ b/pp.h
@@ -431,7 +431,7 @@ Does not use C<TARG>. See also C<XPUSHu>, C<mPUSHu> and C<PUSHu>.
/* No longer used in core. Use AMG_CALLunary instead */
#define AMG_CALLun(sv,meth) AMG_CALLunary(sv, CAT2(meth,_amg))
-#define tryAMAGICunTARGET(meth, shift) \
+#define tryAMAGICunTARGET(meth, shift, jump) \
STMT_START { \
dSP; \
sp--; /* get TARGET from below PL_stack_sp */ \
@@ -449,7 +449,12 @@ Does not use C<TARG>. See also C<XPUSHu>, C<mPUSHu> and C<PUSHu>.
if (opASSIGN) \
sp--; \
SETTARG; \
- RETURN; \
+ PUTBACK; \
+ if (jump) { \
+ PL_markstack_ptr--; \
+ return NORMAL->op_next->op_next; \
+ } \
+ return NORMAL; \
} \
} \
} STMT_END