diff --git a/CHANGELOG.md b/CHANGELOG.md index d3af2de10..7f24fa344 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. ### Fixed - #1457 AS3 switch without lookupswitch ins detection +- #1457 pushing on stack before exit item (return/throw) ## [11.2.0] - 2018-09-08 ### Added diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java index a4235491b..7db0bb9c9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java @@ -2546,11 +2546,23 @@ public class Graph { protected static void makeAllCommands(List commands, TranslateStack stack) { int clen = commands.size(); - if (!commands.isEmpty()) { - if (commands.get(commands.size() - 1) instanceof BreakItem) { + if (clen > 0) { + if (commands.get(clen - 1) instanceof ScriptEndItem) { clen--; } - if (commands.get(commands.size() - 1) instanceof ContinueItem) { + } + if (clen > 0) { + if (commands.get(clen - 1) instanceof ExitItem) { + clen--; + } + } + if (clen > 0) { + if (commands.get(clen - 1) instanceof BreakItem) { + clen--; + } + } + if (clen > 0) { + if (commands.get(clen - 1) instanceof ContinueItem) { clen--; } }