diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-07-25 20:15:36 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-07-25 22:08:32 -0700 |
commit | 9a0c99494cbbb7d1253332ab4ce0581e90f707a7 (patch) | |
tree | 98ceb547aaaadfecdcf45c59bb9c4b582f4af588 /op.c | |
parent | 8777c9be0f45ac3c917698c1afb18e1e8507a188 (diff) | |
download | perl-9a0c99494cbbb7d1253332ab4ce0581e90f707a7.tar.gz |
Don’t let ?: folding affect stat
stat(${\1} ? foo : bar) and stat(1 ? foo : bar) should behave the same
way, but were treated differently, due to the way ?: is folded in
the latter case. Now that foldedness is recorded in the op tree
(cc2ebcd7902), we can use the OPpCONST_FOLDED flag to distinguish
stat(1 ? foo : bar) from stat(foo).
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -8130,7 +8130,8 @@ Perl_ck_ftst(pTHX_ OP *o) SVOP * const kid = (SVOP*)cUNOPo->op_first; const OPCODE kidtype = kid->op_type; - if (kidtype == OP_CONST && (kid->op_private & OPpCONST_BARE)) { + if (kidtype == OP_CONST && (kid->op_private & OPpCONST_BARE) + && !(kid->op_private & OPpCONST_FOLDED)) { OP * const newop = newGVOP(type, OPf_REF, gv_fetchsv(kid->op_sv, GV_ADD, SVt_PVIO)); #ifdef PERL_MAD |