summaryrefslogtreecommitdiff
path: root/op.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-09-20 22:05:34 -0700
committerFather Chrysostomos <sprout@cpan.org>2010-09-20 22:05:34 -0700
commit2474a784a94d8c70aea9c330d9f2a902b8a68b85 (patch)
treeb09595a0bb76d458489b7aee6fef31f7286c1c9e /op.h
parentaf9838cc2fa3350e15e88a27008899ae3a3afdb6 (diff)
downloadperl-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.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/op.h b/op.h
index 2ffd3e6f16..da280b8b8d 100644
--- a/op.h
+++ b/op.h
@@ -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