summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--op.c7
-rw-r--r--t/lib/warnings/op1
2 files changed, 5 insertions, 3 deletions
diff --git a/op.c b/op.c
index 1366976c1f..bcf4fb63ad 100644
--- a/op.c
+++ b/op.c
@@ -4686,9 +4686,10 @@ Perl_ck_bitop(pTHX_ OP *o)
(op) == OP_NE || (op) == OP_I_NE || \
(op) == OP_NCMP || (op) == OP_I_NCMP)
o->op_private = (U8)(PL_hints & HINT_PRIVATE_MASK);
- if (o->op_type == OP_BIT_OR
- || o->op_type == OP_BIT_AND
- || o->op_type == OP_BIT_XOR)
+ if (!(o->op_flags & OPf_STACKED) /* Not an assignment */
+ && (o->op_type == OP_BIT_OR
+ || o->op_type == OP_BIT_AND
+ || o->op_type == OP_BIT_XOR))
{
OP * left = cBINOPo->op_first;
OP * right = left->op_sibling;
diff --git a/t/lib/warnings/op b/t/lib/warnings/op
index 58056a6ce5..35779a9f5a 100644
--- a/t/lib/warnings/op
+++ b/t/lib/warnings/op
@@ -909,6 +909,7 @@ $a = $b < $c & $d;
$a = $b >= $c ^ $d;
$a = $b <= $c | $d;
$a = $b <=> $c & $d;
+$a &= $b == $c; $a |= $b == $c; $a ^= $b == $c; # shouldn't warn
no warnings 'precedence';
$a = $b & $c == $d;
$a = $b ^ $c != $d;