: WARNING - support of the decompiler is now VERY LIMITED. There are no active developers. This means waiting times in the issue tracker are very long and mostly depend on community. Sorry for the inconvenience.

List of issuesList of issues

#101 AS 1/2 while + increment/decrement
Author: user pepka
Date created:
Type: bug
Visibility: Everybody
Assigned to:
Labels: AS1/2Decompilation
State: closed Help

> What steps will reproduce the problem? While loop that contains an increment or decrement in its condition part decompiles into infinite loop (do ... while(true)). > What is the expected output? What do you see instead? while (a--) { b = a * 2; } vs do { register4=register4-1; if(register4) { register5=register4*2; continue; } } while(true); > What version of the product are you using? On what operating system? 1.6.0u1
admin
State: new→opened
admin
version 1.6.1 was released. This issue should be fixed.
State: opened→upgraded
user
Hi, the problem persists. Now the given example produces only function init($start, $end) { var register4=$start; var register5=$end; register4++; } instead of what is in .as file.
admin
State: upgraded→opened
admin
Version 1.6.2 was released. New loop detection algorithm should solve this, try it.
State: opened→upgraded
user
Hi, still have 2 flaws: 1. For the given example it misses else clause in if(register4>register5) { while(register4--) { register5=register4*2; } } <=== here other while should go to else clause while(register4--<0) { register5=register4+2; } You can see it in source as well as in p-code: If loc00ec ... loc00e7:Jump loc011d loc00ec:Push register4 register4 ... 2. It works for decrement, but the same snippet with increment produces wrong code and raises a few exceptions: ???? 10, 2013 2:53:40 PM com.jpexs.decompiler.flash.SWFInputStream readActionListAtPos SEVERE: Disassembly exception java.util.EmptyStackException at java.util.Stack.peek(Unknown Source) at java.util.Stack.pop(Unknown Source) at com.jpexs.decompiler.flash.action.swf5.ActionLess2.translate(ActionLess2.java:40) at com.jpexs.decompiler.flash.action.Action.translate(Action.java:668) at com.jpexs.decompiler.flash.SWFInputStream.readActionListAtPos(SWFInputStream.java:1011) at com.jpexs.decompiler.flash.SWFInputStream.readActionListAtPos(SWFInputStream.java:1095) at com.jpexs.decompiler.flash.SWFInputStream.readActionListAtPos(SWFInputStream.java:1060) at com.jpexs.decompiler.flash.SWFInputStream.readActionList(SWFInputStream.java:736) at com.jpexs.decompiler.flash.tags.DoInitActionTag.getActions(DoInitActionTag.java:122) at com.jpexs.decompiler.flash.action.gui.ActionPanel.cacheScript(ActionPanel.java:119) at com.jpexs.decompiler.flash.action.gui.ActionPanel.access$3(ActionPanel.java:117) at com.jpexs.decompiler.flash.action.gui.ActionPanel$1.run(ActionPanel.java:252)
admin
State: upgraded→opened
admin
version 1.6.3 released, loop detection was improved, increment fixed. this issue should be fixed now, try it.
State: opened→upgraded
user
It's fixed. Thank you!
admin
State: upgraded→closed
 
Google Translate: Translate to Czech Translate to Slovak Translate to Russian Translate to Hungarian Translate to Swedish Translate to French Translate to German Translate to Spanish Translate to Italian
Change style: oceanic classic