Skip merging logic in IntInterpreter if value1 and value2 are equal

This fixes a problem where dummy arguments that already had more than 8
possible values in their set (because the dummy argument is used in a
greater or less than condition) were not removed, as we'd replace the
IntValue with an unknown value when two branches (where the dummy
argument is not modified) are merged back together.

It should also improve performance, as we'll be doing less memory
allocation.
bzip2
Graham 5 years ago
parent eb7206ee51
commit 8eac1c1ce3
  1. 4
      deob/src/main/java/dev/openrs2/deob/analysis/IntInterpreter.java

@ -221,6 +221,10 @@ public final class IntInterpreter extends Interpreter<IntValue> {
return null; return null;
} }
if (value1.equals(value2)) {
return value1;
}
if (value1.isUnknown() || value2.isUnknown()) { if (value1.isUnknown() || value2.isUnknown()) {
return IntValue.newUnknown(basicValue); return IntValue.newUnknown(basicValue);
} }

Loading…
Cancel
Save