From 3294e1add0de22f80c17b14813d18df42a8b5782 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 14 Feb 2016 15:21:05 -0500 Subject: [PATCH] This took awhile to find. --- .../deob/attributes/code/instructions/GetField.java | 8 ++++++++ .../deob/attributes/code/instructions/GetStatic.java | 8 ++++++++ .../deob/attributes/code/instructions/PutField.java | 10 ++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/runelite/deob/attributes/code/instructions/GetField.java b/src/main/java/net/runelite/deob/attributes/code/instructions/GetField.java index 2d33534d8c..6ff7a50d28 100644 --- a/src/main/java/net/runelite/deob/attributes/code/instructions/GetField.java +++ b/src/main/java/net/runelite/deob/attributes/code/instructions/GetField.java @@ -17,6 +17,7 @@ import net.runelite.deob.pool.NameAndType; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; +import net.runelite.deob.Method; import net.runelite.deob.execution.Value; public class GetField extends Instruction implements GetFieldInstruction @@ -29,6 +30,13 @@ public class GetField extends Instruction implements GetFieldInstruction super(instructions, type, pc); } + @Override + public String toString() + { + Method m = this.getInstructions().getCode().getAttributes().getMethod(); + return "getfield " + myField + " in " + m; + } + @Override public void load(DataInputStream is) throws IOException { diff --git a/src/main/java/net/runelite/deob/attributes/code/instructions/GetStatic.java b/src/main/java/net/runelite/deob/attributes/code/instructions/GetStatic.java index a6162e246f..edce841f16 100644 --- a/src/main/java/net/runelite/deob/attributes/code/instructions/GetStatic.java +++ b/src/main/java/net/runelite/deob/attributes/code/instructions/GetStatic.java @@ -17,6 +17,7 @@ import net.runelite.deob.pool.NameAndType; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; +import net.runelite.deob.Method; import net.runelite.deob.execution.Value; public class GetStatic extends Instruction implements GetFieldInstruction @@ -36,6 +37,13 @@ public class GetStatic extends Instruction implements GetFieldInstruction this.field = field; } + @Override + public String toString() + { + Method m = this.getInstructions().getCode().getAttributes().getMethod(); + return "getstatic " + myField + " in " + m; + } + @Override public void load(DataInputStream is) throws IOException { diff --git a/src/main/java/net/runelite/deob/attributes/code/instructions/PutField.java b/src/main/java/net/runelite/deob/attributes/code/instructions/PutField.java index 049951bb5c..f1a5fc1133 100644 --- a/src/main/java/net/runelite/deob/attributes/code/instructions/PutField.java +++ b/src/main/java/net/runelite/deob/attributes/code/instructions/PutField.java @@ -142,8 +142,14 @@ public class PutField extends Instruction implements SetFieldInstruction PutField thisPf = (PutField) thisIc.getInstruction(), otherPf = (PutField) otherIc.getInstruction(); - return thisPf.getField().getClassEntry().equals(otherPf.getField().getClassEntry()) - && thisPf.getField().getNameAndType().getDescriptorType().equals(otherPf.getField().getNameAndType().getDescriptorType()); + net.runelite.deob.Field f1 = thisPf.getMyField(), + f2 = otherPf.getMyField(); + + if ((f1 != null) != (f2 != null)) + return false; + + return f1.getFields().getClassFile().getPoolClass().equals(f2.getFields().getClassFile().getPoolClass()) + && f1.getType().equals(f2.getType()); } @Override