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.

#2493 Incorrect placement of §§push instructions
Author:
JPEXS

Date created:
Type: bug
Visibility: Everybody
Assigned to:
Labels: Decompilation
State: upgraded 

> What steps will reproduce the problem?
Compile following AS3 p-code in FFDec:
(It is simillar in AS1/2)
```
getlocal0
pushscope
debug 1, "a", 0, 13
debug 1, "b", 1, 14
pushbyte 1
convert_i
setlocal1
pushbyte 2
coerce_a
setlocal2
getlocal1 ; this one at this place generates §§push
getlocal1
pushbyte 1
add
convert_i
setlocal1
getlocal2
pushbyte 2
ifnge ofs0031
pushbyte 7
add
coerce_a
setlocal2
findpropstrict QName(PackageNamespace(""),"trace")
getlocal2
callpropvoid QName(PackageNamespace(""),"trace"), 1
jump ofs0032
ofs0031:
pop
ofs0032:
returnvoid
```
> What is the expected output? What do you see instead?
Expected output is:
```
var a:int = 1;
var b:* = 2;
§§push(a); //correct placement, before increment
a += 1;
if(b >= 2)
{
b = §§pop() + 7;
trace(b);
}
else
{
§§pop();
}
```
Instead there is:
```
var a:int = 1;
var b:* = 2;
a += 1;
§§push(a); //incorrect placement, after the increment
if(b >= 2)
{
b = §§pop() + 7;
trace(b);
}
else
{
§§pop();
}
```
The §§push is generated always together with the next block statement ("if" here),
it should be placed at the place where the real push was executed,
otherwise it might look like there is pushed something else than was originally.
> What version of the product are you using? Is it "nightly build"? Which operating system
do you have?
24.0.1 nightly 3249, 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.
The problem usually happens in obfuscated files, no normal file will generate that,
but I think FFDec should really handle this and produce correct results.
This was fixed few nightly builds ago. Current nightly build: nightly 3266.
State: new→upgraded