diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java index 5a0ecb587..0cbe9a6ef 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java @@ -1400,8 +1400,15 @@ public class AVM2Graph extends Graph { //should not happen finallyCommands.clear(); } + //remove Dup before switch + if (!finallyCommands.isEmpty() && finallyCommands.get(finallyCommands.size() - 1) instanceof SetTemporaryItem) { + SetTemporaryItem st = (SetTemporaryItem) finallyCommands.get(finallyCommands.size() - 1); + if (st.value instanceof PopItem) { + finallyCommands.remove(finallyCommands.size() - 1); + } + } stack.pop(); //duplicated switched value - stack.pop(); //value switched by lookupswitch + stack.pop(); //value switched by lookupswitch } }