fix: correctly handle variable in ternary transform

This commit is contained in:
Skylot
2025-11-20 20:30:10 +00:00
parent 9bf079aad4
commit 2fba204b33
2 changed files with 2 additions and 1 deletions
@@ -122,6 +122,7 @@ public class TernaryMod extends AbstractRegionVisitor implements IRegionIterativ
int branchLine = Math.max(thenInsn.getSourceLine(), elseInsn.getSourceLine());
ternInsn.setSourceLine(Math.max(ifRegion.getSourceLine(), branchLine));
thenInsn.setResult(null); // unset without unbind, SSA var still in use
InsnRemover.unbindResult(mth, elseInsn);
// remove 'if' instruction
@@ -52,7 +52,7 @@ public class DebugChecks {
try {
checkMethod(mth);
} catch (Exception e) {
throw new JadxRuntimeException("Debug check failed after visitor: " + visitor, e);
mth.addError("Debug check failed after visitor: " + visitor, e);
}
}