JPEXS Free Flash Decompiler Issue Tracker

If you are looking for the decompiler itself, visit https://github.com/jindrapetrik/jpexs-decompiler

NEW : We have got a new blog where we post some interesting SWF internals info.

List of issuesList of issues

#2473 Always-break loops containing breaks handled incorrectly
Author:
Date created:
Type: bug
Visibility: Everybody
Assigned to:
State: opened Help

> What steps will reproduce the problem? Compile (in FFDec for example) following AS1 code: ``` while(true) { var v = 5; trace("a"); if(v > 4) { trace("b"); if(v > 10) { trace("c"); break; //standard "break", should lead to "f" } else { trace("d"); } } trace("e"); break; //"always break loop" } trace("f"); ``` > What is the expected output? What do you see instead? I see following: ``` if(true) { var v = 5; trace("a"); if(v > 4) { trace("b"); if(v > 10) { trace("c"); } else { trace("d"); } } trace("e"); } trace("f"); ``` The block "c" continues to block "e". Expected: "c" should continue to block "f", not "e". There should be break statement or equivalent. The while(true) or similar "goto forward" breakable structure should be generated. > What version of the product are you using? Is it "nightly build"? Which operating system do you have? 23.0.1 nightly 3210, Windows 11 > Please provide any additional information below. If the problem is related to a SWF file, attach it here, otherwise we can't help you.
In 24.0.1 nightly 3221, it decompiles as: ``` if(true) { var v = 5; trace("a"); if(v > 4) { trace("b"); if(v > 10) { trace("c"); } else { trace("d"); addr28: trace("e"); } §§goto(addr31); } §§goto(addr28); } addr31: trace("f"); ``` Which is formally correct, as all control flow is same as original. It still needs some polishing - to remove the §§goto statement and introduce always-break while loop.
State: new→opened