Change 20171 by [EMAIL PROTECTED] on 2003/07/20 20:12:54

        The warning "Possible precedence problem on bitwise operator"
        was incorrectly produced with the bitwise-assignment operators.
        Fix it. (bug #23065 concerning 5.8.1 RC2)

Affected files ...

... //depot/perl/op.c#579 edit
... //depot/perl/t/lib/warnings/op#20 edit

Differences ...

==== //depot/perl/op.c#579 (text) ====
Index: perl/op.c
--- perl/op.c#578~20166~        Thu Jul 17 14:49:10 2003
+++ perl/op.c   Sun Jul 20 13:12:54 2003
@@ -4686,9 +4686,10 @@
         (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;

==== //depot/perl/t/lib/warnings/op#20 (text) ====
Index: perl/t/lib/warnings/op
--- perl/t/lib/warnings/op#19~19588~    Wed May 21 14:03:04 2003
+++ perl/t/lib/warnings/op      Sun Jul 20 13:12:54 2003
@@ -909,6 +909,7 @@
 $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;
End of Patch.

Reply via email to