qemu/target/arm/translate-a64.c:2039: bad test ?

Bug #1813460 reported by dcb
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

qemu/target/arm/translate-a64.c:2039]: (warning) Logical disjunction always evaluates to true: op3 != 2 || op3 != 3.

Source code is

       if (op3 != 2 || op3 != 3) {

Maybe better code

       if (op3 != 2 && op3 != 3) {

Revision history for this message
dcb (dcb314) wrote :

Maybe using gcc flag -Wlogical-op might help find bugs like this in future.

Revision history for this message
Richard Henderson (rth) wrote :

There is a patch on list for this:
https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg06728.html

Using the flag is a good idea.

Changed in qemu:
status: New → In Progress
Revision history for this message
Richard Henderson (rth) wrote :

The patch is now in master.

Changed in qemu:
status: In Progress → Fix Committed
Thomas Huth (th-huth)
Changed in qemu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.