diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-09-20 22:05:34 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-09-20 22:05:34 -0700 |
commit | 2474a784a94d8c70aea9c330d9f2a902b8a68b85 (patch) | |
tree | b09595a0bb76d458489b7aee6fef31f7286c1c9e /op.h | |
parent | af9838cc2fa3350e15e88a27008899ae3a3afdb6 (diff) | |
download | perl-2474a784a94d8c70aea9c330d9f2a902b8a68b85.tar.gz |
[perl #20444] regex not evaluated in constant ?:
$text =~ ( 1 ? /phoo/ : /bear/)
used to be constant-folded to
$text =~ /phoo/
This patch solves the problem by marking match and subst ops as
OPf_SPECIAL during constant folding, so the =~ operator can tell not
to take possession of it.
Diffstat (limited to 'op.h')
-rw-r--r-- | op.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -142,6 +142,10 @@ Deprecated. Use C<GIMME_V> instead. /* On OP_HELEM and OP_HSLICE, localization will be followed by assignment, so do not wipe the target if it is special (e.g. a glob or a magic SV) */ + /* On OP_MATCH, OP_SUBST & OP_TRANS, the + operand of a logical or conditional + that was optimised away, so it should + not be bound via =~ */ /* old names; don't use in new code, but don't break them, either */ #define OPf_LIST OPf_WANT_LIST |