summaryrefslogtreecommitdiff
path: root/pp.h
diff options
context:
space:
mode:
authorBen Morrow <ben@morrow.me.uk>2009-01-20 01:29:50 +0000
committerBen Morrow <ben@morrow.me.uk>2009-03-25 21:14:06 +0000
commit7fb13887d71713a7821f3417b415917a61fdcf6c (patch)
tree6199a71c8810cf3a5d98532f71075a240ce88588 /pp.h
parent4d57d24f51f1e1421107065f0f777ed2e565907e (diff)
downloadperl-7fb13887d71713a7821f3417b415917a61fdcf6c.tar.gz
Stacked overloaded -X.
Diffstat (limited to 'pp.h')
-rw-r--r--pp.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/pp.h b/pp.h
index 50fec839c1..f3da1a7f80 100644
--- a/pp.h
+++ b/pp.h
@@ -473,6 +473,7 @@ Does not use C<TARG>. See also C<XPUSHu>, C<mPUSHu> and C<PUSHu>.
#define tryAMAGICftest(chr) \
STMT_START { \
+ assert(chr != '?'); \
if (SvAMAGIC(TOPs)) { \
const char tmpchr = (chr); \
SV * const tmpsv = amagic_call(TOPs, \
@@ -480,7 +481,19 @@ Does not use C<TARG>. See also C<XPUSHu>, C<mPUSHu> and C<PUSHu>.
ftest_amg, AMGf_unary); \
\
if (tmpsv) { \
+ const OP *next = PL_op->op_next; \
+ \
SPAGAIN; \
+ \
+ if (next->op_type >= OP_FTRREAD && \
+ next->op_type <= OP_FTBINARY && \
+ next->op_private & OPpFT_STACKED \
+ ) { \
+ if (SvTRUE(tmpsv)) \
+ /* leave the object alone */ \
+ RETURN; \
+ } \
+ \
SETs(tmpsv); \
RETURN; \
} \