mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-01 08:45:08 +00:00
goto detection improvements
This commit is contained in:
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.AVM2LocalData;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.debug.DebugLineIns;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfStrictEqIns;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.JumpIns;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.LookupSwitchIns;
|
||||
@@ -831,6 +832,24 @@ public class AVM2Graph extends Graph {
|
||||
return next;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isPartEmpty(GraphPart part) {
|
||||
if (part.nextParts.size() > 1) {
|
||||
return false;
|
||||
}
|
||||
if (part.start < 0) {
|
||||
return false;
|
||||
}
|
||||
for (int ip = part.start; ip <= part.end; ip++) {
|
||||
if (!(avm2code.code.get(ip).definition instanceof DebugLineIns)
|
||||
&& !(avm2code.code.get(ip).definition instanceof JumpIns)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected GraphTargetItem checkLoop(LoopItem loopItem, BaseLocalData localData, List<Loop> loops) {
|
||||
AVM2LocalData aLocalData = (AVM2LocalData) localData;
|
||||
|
||||
Reference in New Issue
Block a user