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

Bug #1813460 reported by dcb on 2019-01-27
This bug affects 1 person
Affects Status Importance Assigned to Milestone

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) {

dcb (dcb314) wrote :

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

Richard Henderson (rth) wrote :

There is a patch on list for this:

Using the flag is a good idea.

Changed in qemu:
status: New → In Progress
Richard Henderson (rth) wrote :

The patch is now in master.

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

Other bug subscribers