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

#2114 compiler ignores parenthesis important for order of execution
Author: user 3plus4i
Date created:
Type: question
Visibility: Everybody
Assigned to:
Labels: Decompilation
State: opened Help

The compiler doesn't seem to be able to determine, whether parenthesis are important for the order of execution in a chain of statements. a || (b && c) && d && e && f is not the same as a || b && c && d && e && f The specific line I was using is if(this.autosaveTimer == 0 || (this.director.state == "pause" && this.director.menu.prevState == "dungeon") && this.director.player.tutorialState == "Ended" && dungeon != 5 && dungeon != 7) I tried swapping the part in parenthesis with the first part, but that still gives a wrong result, with the parenthesis removed. I'm pretty sure I have seen the parenthesis work in other contexts, at least in numerical operations, but I'm not entirely sure. > What version of the product are you using? Is it "nightly build"? Which operating system do you have? 19.1.2 DEB package > Please provide any additional information below. If the problem is related to a SWF file, attach it here, otherwise we can't help you. I don't think the specific file is of much relevance, but if it would be helpful, I can provide it
admin
Logical or operator || has lower precedence than logical and && operator. This means a || (b && c) && d && e && f is equal to a || (b && c && d && e && f) and that is equal to a || b && c && d && e && f as && part is calculated calculated first. if you want to make a || (b && c) first, then you need to use parenthesis this way: (a || (b && c)) && d && e && f
State: new→opened
Type: bug→question
user
I failed to reply yet that I was indeed confidently incorrect about precedence of || and &&. It was the code that I wrote, that was faulty, not the compilation.