From 8eac1c1ce36d97c625fa72b908be7f2d2ee88f21 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 12 Oct 2019 11:55:37 +0100 Subject: [PATCH] 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. --- .../main/java/dev/openrs2/deob/analysis/IntInterpreter.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deob/src/main/java/dev/openrs2/deob/analysis/IntInterpreter.java b/deob/src/main/java/dev/openrs2/deob/analysis/IntInterpreter.java index 5d234d65c7..3d29d2ed46 100644 --- a/deob/src/main/java/dev/openrs2/deob/analysis/IntInterpreter.java +++ b/deob/src/main/java/dev/openrs2/deob/analysis/IntInterpreter.java @@ -221,6 +221,10 @@ public final class IntInterpreter extends Interpreter { return null; } + if (value1.equals(value2)) { + return value1; + } + if (value1.isUnknown() || value2.isUnknown()) { return IntValue.newUnknown(basicValue); }