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.

#104 AS3: inc/dec loc NullpointerException, Multiple conditions in loops
Author:
pepka

Date created:
Type: bug
Visibility: Everybody
Assigned to:
Labels: AS3Decompilation
State: closed 

> What steps will reproduce the problem?
Decompilation of a given example causes the following error:
???? 30, 2013 5:26:01 PM com.jpexs.decompiler.flash.abc.types.MethodBody toString
SEVERE: Error during remove traps
java.lang.NullPointerException
at com.jpexs.decompiler.flash.graph.BinaryOpItem.isCompileTime(BinaryOpItem.java:70)
...
meanwile producing a quite valid result (please see below).
> What is the expected output? What do you see instead?
do
{
if (var1.x+var1.y>0&¶m1<0)
{
break;
}
...
}
while(true)
source code (see also as file attached) leads to the improper for
for(;!(var1.x+var1.y>0&¶m1<0);continue loop0)
{
if(var1.x>0)
{
param1--;
if(param1<0)
{
return param2;
}
}
else
{
param1++;
if(param1>100)
{
return param2;
}
}
meanwhile the source code of the form (with a simple single condition)
do
{
if (var1.x+var1.y>0)
{
break;
}
...
}
while(true)
produces more proper decompilation
while(var1.x+var1.y<0)
{
...
}
> What version of the product are you using? On what operating system?
1.6.0u1


State: new→opened
Title: NullPointerException→AS3: inc/dec loc NullpointerException, Multiple conditions in loops
version 1.6.1 was released. Both issues should be fixed.
State: opened→upgraded
Hi,
there is no more NullPointerExceptions, thanks!
But decompilation is still not very precise.
And sorry that I have accidently attached project file instead of AS source. Here is it.
And the most recent example too.


State: upgraded→opened
Version 1.6.2 was released.
New loop detection algorithm should solve this, try it.
State: opened→upgraded
Hi,
the loop is ok, but still missing one if in else clause:
while(!(var1.x+var1.y>0&¶m1<0))
{
if(var1.x>0)
{
param1--;
if(param1<0)
{
return param2;
}
}
else
{
param1++;
if(param1>100) <= this one
{ <=
return param2; <=
} <=
}
}
State: upgraded→opened
version 1.6.3 released
it should be ok now, try it
State: opened→upgraded
Now it's fixed. Thanks!
State: upgraded→closed