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:
Luke Serné 2024-05-19 23:03:42 +02:00
parent 8b5f6daf4e
commit 318e4af955

View File

@ -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;