This commit is contained in:
Adam
2016-01-29 21:24:07 -05:00
parent 39ac3f1d68
commit f50c6523c0
3 changed files with 31 additions and 6 deletions

View File

@@ -43,6 +43,10 @@ public class IfICmpEq extends If
if (isZero(s1) || isZero(s2))
return true;
}
else if (otherIc.getInstruction() instanceof IfICmpNe)
{
return true;
}
return false;
}
@@ -50,7 +54,7 @@ public class IfICmpEq extends If
@Override
public void map(ParallelExecutorMapping mapping, InstructionContext ctx, InstructionContext other)
{
if (other.getInstruction() instanceof IfNe)
if (other.getInstruction() instanceof IfNe || other.getInstruction() instanceof IfICmpNe)
{
super.mapOtherBranch(mapping, ctx, other);
}

View File

@@ -3,6 +3,7 @@ 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.PushConstantInstruction;
import net.runelite.deob.deobfuscators.rename.ParallelExecutorMapping;
import net.runelite.deob.execution.InstructionContext;
import net.runelite.deob.execution.StackContext;
@@ -34,7 +35,7 @@ public class IfICmpNe extends If
return true;
// check for other being ifne and this has a constant 0
if (otherIc.getInstruction() instanceof IfNe)
if (otherIc.getInstruction() instanceof IfNe || otherIc.getInstruction() instanceof IfEq)
{
StackContext s1 = thisIc.getPops().get(0),
s2 = thisIc.getPops().get(1);
@@ -45,4 +46,17 @@ public class IfICmpNe extends If
return false;
}
@Override
public void map(ParallelExecutorMapping mapping, InstructionContext ctx, InstructionContext other)
{
if (other.getInstruction() instanceof IfEq)
{
super.mapOtherBranch(mapping, ctx, other);
}
else
{
super.map(mapping, ctx, other);
}
}
}