From e35a92fcf13661fc5a76c82576cc18c67b82584f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sun, 22 Sep 2024 19:03:03 +0200 Subject: [PATCH] Fixed: #2296 AS decompilation - goto problems --- CHANGELOG.md | 4 +++- .../src/com/jpexs/decompiler/graph/Graph.java | 20 +++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27df5bed1..f51702704 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,9 +14,10 @@ All notable changes to this project will be documented in this file. - [#2310] Text search history showing as null - [#2295], [#2311] AS1/2 p-code freezing on highlighting ConstantPool - [#2304] GFX files truncated -- [#2297] AS1/2/3 direct editation - if..else clause broken when using continue/break +- [#2297] AS direct editation - if..else clause broken when using continue/break - [#2291] AS1/2 Incorrect var keyword placement causing registers to compile wrong - [#2290] FLA export - not generating sound bin files causing sound compression setting to be ignored +- [#2296] AS decompilation - goto problems ## [21.0.5] - 2024-09-05 ### Fixed @@ -3565,6 +3566,7 @@ Major version of SWF to XML export changed to 2. [#2297]: https://www.free-decompiler.com/flash/issues/2297 [#2291]: https://www.free-decompiler.com/flash/issues/2291 [#2290]: https://www.free-decompiler.com/flash/issues/2290 +[#2296]: https://www.free-decompiler.com/flash/issues/2296 [#2293]: https://www.free-decompiler.com/flash/issues/2293 [#2294]: https://www.free-decompiler.com/flash/issues/2294 [#2299]: https://www.free-decompiler.com/flash/issues/2299 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 f007f357d..8f971b61f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java @@ -2867,8 +2867,8 @@ public class Graph { if (stopPart.contains(part)) { - boolean hasBlockClosesAfter = false; - //this weird stuff handles some goto problems: + /*boolean hasBlockClosesAfter = false; + //this weird stuff handles some goto problems: loopi: for (int i = 0; i < stopPartKind.size(); i++) { if (stopPart.get(i) == part) { @@ -2883,15 +2883,15 @@ public class Graph { } } - if (!hasBlockClosesAfter) { - if (currentLoop != null) { - currentLoop.phase = 0; - } - if (debugPrintGraph) { - System.err.println("Stopped on part " + part); - } - return ret; + if (!hasBlockClosesAfter) {*/ + if (currentLoop != null) { + currentLoop.phase = 0; } + if (debugPrintGraph) { + System.err.println("Stopped on part " + part); + } + return ret; + //} } if (code.size() <= part.start) {