bo0liu / as3-commons

Automatically exported from code.google.com/p/as3-commons
0 stars 0 forks source link

[bytecode] Alchemy instructions have wrong bytecodes #93

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

    Example code:

    .addOpcode(Opcode.getlocal_1)
    .addOpcode(Opcode.getlocal_2)
    .addOpcode(Opcode.pushint, [2])
    .addOpcode(Opcode.lshift)
    .addOpcode(Opcode.si32)

What is the expected output? What do you see instead?

    Output:
    Opcode.li32 is emitted.

    Expected:
    Opcode.si32 should be emitted.

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

    * Bytecode 1.0
    * Lang 0.3.4
    * Logging 2.6
    * Reflect 1.4.2
    * Windows 7 SP1 x64

Please provide any additional information below.

    It looks like the bytecodes for the Alchemy load instructions and the Alchemy store instructions have been swapped.  For example, si8 is emitted as 0x35 but 0x35 is really li8.  This problem is for s/li8, s/li16, s/li32, s/lif32 and s/lif64.  Swapping the bytecodes for the load and store instructions in Opcode.as fixes the issue in SVN trunk.

Original issue reported on code.google.com by zach.griswold@gmail.com on 23 Sep 2011 at 7:38

GoogleCodeExporter commented 9 years ago
Hey Zach,

thanks for catching that one, I had lifted the alchemy opcodes from various 
sources around the internet. I guess I either copied faulty information or I 
just completely screwed up and swapped them myself. Either way, I've swapped 
them back in the sources, changes are available in the trunk. If you can 
confirm its ok now, then I'll close this issue.
Thanks a lot for bringing this up!

cheers,

Roland

Original comment by ihatelivelyids on 23 Sep 2011 at 7:52

GoogleCodeExporter commented 9 years ago
Looks good!

Original comment by zach.griswold@gmail.com on 23 Sep 2011 at 11:13

GoogleCodeExporter commented 9 years ago
alright, thank!

Original comment by ihatelivelyids on 23 Sep 2011 at 11:47