Fix tests

This commit is contained in:
Adam
2016-02-13 22:28:40 -05:00
parent 770e1f6b2f
commit c1bd2d199e
8 changed files with 30 additions and 247 deletions

View File

@@ -32,6 +32,13 @@ public abstract class If extends Instruction implements JumpingInstruction, Comp
super(instructions, type, pc);
}
public If(Instructions instructions, InstructionType type, Instruction to)
{
super(instructions, type, -1);
this.to = to;
}
public If(Instructions instructions, Instruction to)
{
super(instructions, InstructionType.IF_ICMPNE, -1);

View File

@@ -32,9 +32,9 @@ public abstract class If0 extends Instruction implements JumpingInstruction, Com
super(instructions, type, pc);
}
public If0(Instructions instructions, Instruction to)
public If0(Instructions instructions, InstructionType type, Instruction to)
{
super(instructions, InstructionType.IFEQ, -1);
super(instructions, type, -1);
assert this != to;
assert to.getInstructions() == this.getInstructions();

View File

@@ -1,5 +1,6 @@
package net.runelite.deob.attributes.code.instructions;
import net.runelite.deob.attributes.code.Instruction;
import net.runelite.deob.attributes.code.InstructionType;
import net.runelite.deob.attributes.code.Instructions;
import static net.runelite.deob.attributes.code.instructions.IfICmpEq.isOne;
@@ -14,6 +15,11 @@ public class IfEq extends If0
{
super(instructions, type, pc);
}
public IfEq(Instructions instructions, Instruction to)
{
super(instructions, InstructionType.IFEQ, to);
}
@Override
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)

View File

@@ -1,5 +1,6 @@
package net.runelite.deob.attributes.code.instructions;
import net.runelite.deob.attributes.code.Instruction;
import net.runelite.deob.attributes.code.InstructionType;
import net.runelite.deob.attributes.code.Instructions;
import net.runelite.deob.attributes.code.instruction.types.PushConstantInstruction;
@@ -14,6 +15,11 @@ public class IfICmpEq extends If
super(instructions, type, pc);
}
public IfICmpEq(Instructions instructions, Instruction to)
{
super(instructions, InstructionType.IF_ICMPEQ, to);
}
static boolean is(StackContext s, int val)
{
if (s.getPushed().getInstruction() instanceof PushConstantInstruction)