Remove all-null parameter arrays from the constArgs map

master
Graham 5 years ago
parent 1cec2c3739
commit 95c4741229
  1. 12
      deob/src/main/java/dev/openrs2/deob/transform/DummyTransformer.java

@ -298,14 +298,24 @@ public final class DummyTransformer extends Transformer {
for (var method : inheritedMethodSets) { for (var method : inheritedMethodSets) {
var args = (Type.getArgumentsAndReturnSizes(method.iterator().next().getDesc()) >> 2) - 1; var args = (Type.getArgumentsAndReturnSizes(method.iterator().next().getDesc()) >> 2) - 1;
var allUnknown = true;
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
var parameters = (ImmutableSet<Integer>[]) new ImmutableSet<?>[args]; var parameters = (ImmutableSet<Integer>[]) new ImmutableSet<?>[args];
for (int i = 0; i < args; i++) { for (int i = 0; i < args; i++) {
parameters[i] = union(argValues.get(new ArgRef(method, i))); var parameter = union(argValues.get(new ArgRef(method, i)));
if (parameter != null) {
allUnknown = false;
} }
parameters[i] = parameter;
}
if (allUnknown) {
constArgs.remove(method);
} else {
constArgs.put(method, parameters); constArgs.put(method, parameters);
} }
} }
}
@Override @Override
protected void postTransform(ClassPath classPath) { protected void postTransform(ClassPath classPath) {

Loading…
Cancel
Save