X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pp.h;h=f3da1a7f80500148adda99b2fe08c4303c185c35;hb=8d1f803052eb91513053e3c5aa0d967e4948a64a;hp=a0714e955090f647f5e43de76c3f2b33259bbe5f;hpb=07fe7c6a9fbc767805839cebb0e0e06dd88b0104;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pp.h b/pp.h index a0714e9..f3da1a7 100644 --- a/pp.h +++ b/pp.h @@ -473,14 +473,27 @@ Does not use C. See also C, C and C. #define tryAMAGICftest(chr) \ STMT_START { \ + assert(chr != '?'); \ if (SvAMAGIC(TOPs)) { \ const char tmpchr = (chr); \ SV * const tmpsv = amagic_call(TOPs, \ newSVpvn_flags(&tmpchr, 1, SVs_TEMP), \ - ftest_amg, 0); \ + 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; \ } \