mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-22 12:11:55 +00:00
Decompiler: Fix float comparison inputs swap in rule subflow_convert
The decompiler rule `subflow_convert` would sometimes swap the inputs to the P-Code ops `FLOAT_LESS` and `FLOAT_LESSEQUAL` if the float that was traced happened to be the second input of the operation, because the transformed operation had its inputs hardcoded: the traced float would always be the first input. While this also affected `FLOAT_EQUAL` and `FLOAT_NOTEQUAL`, it does not matter in those cases, because swapping the inputs for those operations is still logically equivalent. Fixes #6528.
This commit is contained in:
parent
8b5f6daf4e
commit
318e4af955
@ -2652,8 +2652,8 @@ bool SubfloatFlow::traceForward(TransformVar *rvn)
|
||||
}
|
||||
if (preexistingGuard(slot, rvn2)) {
|
||||
TransformOp *rop = newPreexistingOp(2, op->code(), op);
|
||||
opSetInput(rop, rvn, 0);
|
||||
opSetInput(rop, rvn2, 1);
|
||||
opSetInput(rop, rvn, slot);
|
||||
opSetInput(rop, rvn2, 1 - slot);
|
||||
terminatorCount += 1;
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user