diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index c63716cfc..22f0b4fcf 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -1468,7 +1468,7 @@ public class AVM2Code implements Serializable { code.add(pos, instruction); } - public int removeTraps(ConstantPool constants, MethodBody body, ABC abc, int scriptIndex, int classIndex, boolean isStatic, String path, HashMap> refs) { + public int removeTraps(ConstantPool constants, MethodBody body, ABC abc, int scriptIndex, int classIndex, boolean isStatic, String path) { removeDeadCode(constants, body); List localData = new ArrayList<>(); localData.add((Boolean) isStatic); //isStatic @@ -1487,6 +1487,7 @@ public class AVM2Code implements Serializable { localData.add((Integer) (scriptIndex)); localData.add(new HashMap()); //localRegAssignmentIps localData.add(Integer.valueOf(0)); + HashMap> refs = visitCode(body); localData.add(refs); localData.add(this); int ret = 0; @@ -2109,7 +2110,7 @@ public class AVM2Code implements Serializable { return true; } if (visited.contains(currentIp)) { - return false; + return true; } visited.add(currentIp); if (refs.containsKey(currentIp)) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java index 10f8a5be6..6477bb1b4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java @@ -51,7 +51,7 @@ public abstract class SetLocalTypeIns extends InstructionDefinition implements S int regId = getRegisterId(ins); GraphTargetItem value = (GraphTargetItem) stack.pop(); if (localRegs.containsKey(regId)) { - localRegs.put(regId, new NotCompileTimeAVM2Item(ins, value)); + localRegs.put(regId, new NotCompileTimeAVM2Item(ins, value)); } else { localRegs.put(regId, value); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java index 2a920a248..658b54eb9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java @@ -74,7 +74,7 @@ public class MethodBody implements Cloneable, Serializable { } public int removeTraps(ConstantPool constants, ABC abc, int scriptIndex, int classIndex, boolean isStatic, String path) { - return code.removeTraps(constants, this, abc, scriptIndex, classIndex, isStatic, path, code.visitCode(this)); + return code.removeTraps(constants, this, abc, scriptIndex, classIndex, isStatic, path); } public HashMap getLocalRegNames(ABC abc) { @@ -124,7 +124,7 @@ public class MethodBody implements Cloneable, Serializable { deobfuscated.markMappedOffsets(); if ((Boolean) Configuration.getConfig("autoDeobfuscate", true)) { try { - deobfuscated.removeTraps(constants, b, abc, scriptIndex, classIndex, isStatic, path, deobfuscated.visitCode(b)); + deobfuscated.removeTraps(constants, b, abc, scriptIndex, classIndex, isStatic, path); } catch (Exception ex) { Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Error during remove traps", ex); }