sushihangover / as3-commons

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

MethodBuilder.addAsmSource() #1034 conversion error #144

Open GoogleCodeExporter opened 8 years ago

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

1. Define a method body using a string source

var source:String = (<![CDATA[
   getlocal_0
   pushscope
   getlocal_1
   pushint 100
   multiply
   setlocal_1
   getlocal_1
   returnvalue
]]>).toString();

methodBuilder.addAsmSource(source);

___

What is the expected output? 

methodBuilder.addAsmSource should generate the method body.

___

What do you see instead?

Error:
#1034: Array to vector conversion

___

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

as3commons-bytecode-1.1.1 on Windows 8

___

Posible fix:
On org.as3commons.bytecode.emit.impl.MethodBodyBuilder
Line 397
Change: addOpcodes(result[0]);
To: addOpcodes(Vector.<Op>(result[0]));

Line: 431
Chage:_backpatches = _backpatches.concat(newBackpatches);
To: _backpatches = _backpatches.concat(Vector.<JumpTargetData>(newBackpatches));

Original issue reported on code.google.com by hamuyrod...@gmail.com on 10 Feb 2014 at 3:25