Actually this
This commit is contained in:
@@ -7,5 +7,5 @@ public interface MappableInstruction
|
||||
{
|
||||
void map(ParallelExecutorMapping mappings, InstructionContext ctx, InstructionContext other);
|
||||
|
||||
boolean isSame(MappableInstruction other);
|
||||
boolean isSame(InstructionContext thisIc, InstructionContext otherIc);
|
||||
}
|
||||
|
||||
@@ -120,8 +120,8 @@ public abstract class If extends Instruction implements JumpingInstruction, Comp
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSame(MappableInstruction other)
|
||||
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
|
||||
{
|
||||
return this.getClass() == other.getClass();
|
||||
return thisIc.getInstruction().getClass() == otherIc.getInstruction().getClass();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,8 +118,8 @@ public abstract class If0 extends Instruction implements JumpingInstruction, Com
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSame(MappableInstruction other)
|
||||
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
|
||||
{
|
||||
return this.getClass() == other.getClass();
|
||||
return thisIc.getInstruction().getClass() == otherIc.getInstruction().getClass();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.attributes.code.instruction.types.MappableInstruction;
|
||||
import net.runelite.deob.execution.InstructionContext;
|
||||
|
||||
public class IfNe extends If0
|
||||
{
|
||||
@@ -10,4 +12,17 @@ public class IfNe 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 IfCmpNe)
|
||||
{
|
||||
// check for one side being 0
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,8 +173,8 @@ public class InvokeInterface extends Instruction implements InvokeInstruction
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSame(MappableInstruction other)
|
||||
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
|
||||
{
|
||||
return this.getClass() == other.getClass();
|
||||
return thisIc.getInstruction().getClass() == otherIc.getInstruction().getClass();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,8 +168,8 @@ public class InvokeSpecial extends Instruction implements InvokeInstruction
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSame(MappableInstruction other)
|
||||
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
|
||||
{
|
||||
return this.getClass() == other.getClass();
|
||||
return thisIc.getInstruction().getClass() == otherIc.getInstruction().getClass();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,8 +176,8 @@ public class InvokeStatic extends Instruction implements InvokeInstruction
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSame(MappableInstruction other)
|
||||
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
|
||||
{
|
||||
return this.getClass() == other.getClass();
|
||||
return thisIc.getInstruction().getClass() == otherIc.getInstruction().getClass();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,8 +177,8 @@ public class InvokeVirtual extends Instruction implements InvokeInstruction
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSame(MappableInstruction other)
|
||||
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
|
||||
{
|
||||
return this.getClass() == other.getClass();
|
||||
return thisIc.getInstruction().getClass() == otherIc.getInstruction().getClass();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,8 +124,8 @@ public class PutField extends Instruction implements SetFieldInstruction
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSame(MappableInstruction other)
|
||||
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
|
||||
{
|
||||
return this.getClass() == other.getClass();
|
||||
return thisIc.getInstruction().getClass() == otherIc.getInstruction().getClass();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,8 +106,8 @@ public class PutStatic extends Instruction implements SetFieldInstruction
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSame(MappableInstruction other)
|
||||
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
|
||||
{
|
||||
return this.getClass() == other.getClass();
|
||||
return thisIc.getInstruction().getClass() == otherIc.getInstruction().getClass();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,8 @@ public class MappingExecutorUtil
|
||||
|
||||
MappableInstruction mi1 = (MappableInstruction) p1.getInstruction(),
|
||||
mi2 = (MappableInstruction) p2.getInstruction();
|
||||
assert mi1.isSame(mi2);
|
||||
|
||||
assert mi1.isSame(p1, p2);
|
||||
//assert p1.getInstruction().getClass().equals(p2.getInstruction().getClass());
|
||||
|
||||
mi1.map(mappings, p1, p2);
|
||||
|
||||
Reference in New Issue
Block a user