google-code-export / asdec

Automatically exported from code.google.com/p/asdec
1 stars 0 forks source link

ifne is ifeq #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using ifne will make an ifeq
2.
3.

What is the expected output? What do you see instead?
Using ifne should be if not equal !=, but is using ifeq if equal == instead.

This can't detect if local1 contains hey, which it should do.
getlocal_1
pushstring "hey"
ifeq ofs0001
//Some random code here
ofs001:returnvoid

This will detect the message hey, and its using if not equal..
getlocal_1
pushstring "hey"
ifne ofs0001
//Some random code here
ofs001:returnvoid

What version of the product are you using? On what operating system?
1.1.0 Windows 7 

Could you provide the SWF file you have problem with?
If the answer is yes, then please attach it here or send me it via email.
Could you at least attach PCode source?

Do you have the original source code which produced the wrong
decompilation? If yes, then please attach it.

Please provide any additional information below.

Original issue reported on code.google.com by capas...@gmail.com on 20 Jan 2013 at 6:57

GoogleCodeExporter commented 9 years ago
Hi,

getlocal_1
pushstring "hey"
ifeq ofs0001
//when not eq
ofs0001:
means that if the values on the stack are the same, then jump to ofs0001. The 
code between "ifeq ofs0001" and "ofs0001" is executed when the values are 
different. So this is translated as
if(loc1!="hey"){
  //when not eq
}

I don't see a problem here. Could you provide more details where the problem is?

You write ifeq in the pcode and it is changed to ifne? Or the decompiled text 
is wrong?

Original comment by jindra.p...@gmail.com on 20 Jan 2013 at 7:21

GoogleCodeExporter commented 9 years ago
I use ifne, because it works as ifeq. Which it shouldnt do at all.
When I edit the p-code, and I have added a ifne, i see (param1 == "hey"), and 
it doesn't show (param1 != "hey") which it should do. So I guess something is 
messed up.

Original comment by capas...@gmail.com on 20 Jan 2013 at 7:32

GoogleCodeExporter commented 9 years ago
Yes, that is true, the meaning is "inverted".
It is not messed up, this is how PCode works.
The "ifeq" means, when the values are equal, then JUMP.
When Flash executes this instruction and the values are equal, then it skips 
all the code between "ifeq ofs1" and the label name "ofs1:". When the values 
are not equal, no JUMP is done and code between "ifeq ofs1" and the label name 
"ofs1:" is executed.

Original comment by jindra.p...@gmail.com on 20 Jan 2013 at 7:40