From 4e191a701f86dfe3ec0ad7d326314761f416b5fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sun, 24 Jan 2021 15:13:32 +0100 Subject: [PATCH] setlocal..getlocal..nootheruse --- .../jpexs/decompiler/flash/abc/avm2/AVM2Code.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index 33196ec0f..c5389d911 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -1646,6 +1646,21 @@ public class AVM2Code implements Cloneable { ip++; continue iploop; } + } else if (!USE_KILL_INS && (ins.definition instanceof SetLocalTypeIns) && (ip + 1 <= end)) { // set_local_x,get_local_x.. no other local_x get + AVM2Instruction insAfter = code.get(ip + 1); + Set usages = setLocalPosToGetLocalPos.get(ip); + + if (usages.size() == 1 && (usages.iterator().next().equals(ip + 1)) && (insAfter.definition instanceof GetLocalTypeIns) && (((GetLocalTypeIns) insAfter.definition).getRegisterId(insAfter) == ((SetLocalTypeIns) ins.definition).getRegisterId(ins))) { + /*GraphTargetItem before = stack.peek(); + ins.definition.translate(setLocalPosToGetLocalPos, lineStartItem, isStatic, scriptIndex, classIndex, localRegs, stack, scopeStack, ins, output, body, abc, localRegNames, fullyQualifiedNames, path, localRegAssigmentIps, ip, refs, this, thisHasDefaultToPrimitive); + stack.push(before);*/ + ip += 2; + continue iploop; + } else { + ins.definition.translate(setLocalPosToGetLocalPos, lineStartItem, isStatic, scriptIndex, classIndex, localRegs, stack, scopeStack, ins, output, body, abc, localRegNames, fullyQualifiedNames, path, localRegAssigmentIps, ip, refs, this, thisHasDefaultToPrimitive); + ip++; + continue iploop; + } } else if (ins.definition instanceof DupIns) { int nextPos; do {