mappable test seems to not work well, I think because of static methods

This commit is contained in:
Adam
2016-01-13 18:02:36 -05:00
parent 3b4ea9ce0d
commit 35ca054da8
4 changed files with 73 additions and 13 deletions

View File

@@ -2,6 +2,9 @@ package net.runelite.deob.attributes.code.instructions;
import net.runelite.deob.attributes.code.InstructionType;
import net.runelite.deob.attributes.code.Instructions;
import net.runelite.deob.deobfuscators.rename.ParallelExecutorMapping;
import net.runelite.deob.execution.InstructionContext;
import net.runelite.deob.execution.StackContext;
public class IfACmpNe extends If
{
@@ -9,4 +12,28 @@ public class IfACmpNe extends If
{
super(instructions, type, pc);
}
@Override
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
{
if (super.isSame(thisIc, otherIc))
return true;
if (otherIc.getInstruction() instanceof IfNonNull)
{
StackContext s1 = thisIc.getPops().get(0),
s2 = thisIc.getPops().get(1);
if (s1.getPushed().getInstruction() instanceof AConstNull)
{
return true;
}
if (s2.getPushed().getInstruction() instanceof AConstNull)
{
return true;
}
}
return false;
}
}

View File

@@ -2,6 +2,8 @@ package net.runelite.deob.attributes.code.instructions;
import net.runelite.deob.attributes.code.InstructionType;
import net.runelite.deob.attributes.code.Instructions;
import net.runelite.deob.execution.InstructionContext;
import net.runelite.deob.execution.StackContext;
public class IfNonNull extends If0
{
@@ -10,4 +12,27 @@ public class IfNonNull extends If0
super(instructions, type, pc);
}
@Override
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
{
if (super.isSame(thisIc, otherIc))
return true;
if (otherIc.getInstruction() instanceof IfACmpNe)
{
StackContext s1 = otherIc.getPops().get(0),
s2 = otherIc.getPops().get(1);
if (s1.getPushed().getInstruction() instanceof AConstNull)
{
return true;
}
if (s2.getPushed().getInstruction() instanceof AConstNull)
{
return true;
}
}
return false;
}
}

View File

@@ -18,6 +18,7 @@ import net.runelite.deob.util.JarUtil;
public class MappingExecutorUtil
{
// won't work with static funcs etc
public static boolean isMappable(Method m1, Method m2)
{
assert (m1.getCode() == null) == (m2.getCode() == null);