summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorYitzchak Scott-Thoennes <sthoenna@efn.org>2003-05-18 12:21:01 -0700
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-05-19 19:20:48 +0000
commit96a925ab0077cdd24bd7d328f20be3d5373d4885 (patch)
treeba56d920887bb0af1e99b553e418f91257e0a25a /op.c
parent87edd44619c51e5cef57cfe22210ce04d510fd47 (diff)
downloadperl-96a925ab0077cdd24bd7d328f20be3d5373d4885.tar.gz
Re: Possible precedence problem on bitwise ^ operator
Message-ID: <N+Dy+gzkg+XX092yn@efn.org> (with tweaks to perldiag.pod) p4raw-id: //depot/perl@19570
Diffstat (limited to 'op.c')
-rw-r--r--op.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/op.c b/op.c
index 86cfe23654..97e6e73d3f 100644
--- a/op.c
+++ b/op.c
@@ -4619,9 +4619,12 @@ Perl_ck_bitop(pTHX_ OP *o)
|| o->op_type == OP_BIT_AND
|| o->op_type == OP_BIT_XOR)
{
- OPCODE typfirst = cBINOPo->op_first->op_type;
- OPCODE typlast = cBINOPo->op_first->op_sibling->op_type;
- if (OP_IS_NUMCOMPARE(typfirst) || OP_IS_NUMCOMPARE(typlast))
+ OP * left = cBINOPo->op_first;
+ OP * right = left->op_sibling;
+ if ((OP_IS_NUMCOMPARE(left->op_type) &&
+ (left->op_flags & OPf_PARENS) == 0) ||
+ (OP_IS_NUMCOMPARE(right->op_type) &&
+ (right->op_flags & OPf_PARENS) == 0))
if (ckWARN(WARN_PRECEDENCE))
Perl_warner(aTHX_ packWARN(WARN_PRECEDENCE),
"Possible precedence problem on bitwise %c operator",