Fatal error: exception Invalid_argument("index out of bounds") with SWC

156 views
Skip to first unread message

Laurent Deketelaere

unread,
Apr 21, 2016, 6:06:56 AM4/21/16
to Haxe
Hello, 

I am currently port a big AS3 project to Haxe. 
To avoid converting all the code, I have generated an SWC with all dependencies (AS3 libraries, SWC, MXML) and only convert the project source code in Haxe. 
To created the SWC I use compc Ant task from FlexSDK (4.12.0). 

The plan sounds good, but I meet a problem with the generated SWC at Haxe compilation (haxe 3.2.1 on Windows 7 Pro). 

When I want to use the swc like ‘-swf-lib’, I get Fatal error: exception Invalid_argument("index out of bounds")
Raised by primitive operation at file "as3hlparse.ml", line 386, characters 111-
125

This is the line 386 in as3hlparse.ml
| A3MParams (id,pl) -> HMParams (parse_name names ctx names.(idx id),List.map (fun id -> parse_name names ctx names.(idx id)) pl)

For few days, I try to locate the origin of error without success. 

Do you know a solution to have more verbose mode?  
For now, I use “set OCAMLRUNPARAM=b”

The full error message: 
haxe build/haxe/build-src.hxml -swf client.swf -v
Classpath : ./src-haxe/;C:\Work\HaxeToolkit\haxe\extraLibs/;;C:\Work\HaxeToolkit
\haxe\std/flash/_std/;C:\Work\HaxeToolkit\haxe\std/
Defines : true;hxcpp_api_level;haxe_ver;haxe3;flash9;flash11_5;flash11_4;flash11
_3;flash11_2;flash11_1;flash11;flash10_3;flash10_2;flash10_1;flash10;flash;dce
Parsed C:\Work\HaxeToolkit\haxe\std/StdTypes.hx
Parsed C:\Work\HaxeToolkit\haxe\std/String.hx
Parsed C:\Work\HaxeToolkit\haxe\std/Array.hx
Parsed C:\Work\HaxeToolkit\haxe\std/haxe/EnumTools.hx
Parsed C:\Work\HaxeToolkit\haxe\std/StdTypes.hx
Parsed C:\Work\HaxeToolkit\haxe\std/neko/_std/String.hx
Parsed C:\Work\HaxeToolkit\haxe\std/neko/_std/Array.hx
Parsed C:\Work\HaxeToolkit\haxe\std/haxe/EnumTools.hx
Parsed C:\Work\HaxeToolkit\haxe\std/haxe/macro/Expr.hx
Fatal error: exception Invalid_argument("index out of bounds")
Raised by primitive operation at file "as3hlparse.ml", line 386, characters 111-
125
Called from file "list.ml", line 55, characters 20-23
Called from file "as3hlparse.ml", line 386, characters 70-129
Called from file "array.ml", line 79, characters 21-40
Called from file "as3hlparse.ml", line 471, characters 14-64
Called from file "genswf.ml", line 390, characters 10-30
Called from file "genswf.ml", line 487, characters 33-55
Called from file "list.ml", line 73, characters 12-15
Called from file "genswf.ml", line 484, characters 1-192
Called from file "genswf.ml", line 499, characters 11-29
Called from file "genswf.ml", line 507, characters 24-34
Called from file "genswf.ml", line 513, characters 32-43
Called from file "typeload.ml", line 3259, characters 12-20
Called from file "typeload.ml", line 3264, characters 4-33
Called from file "typeload.ml", line 277, characters 8-55
Called from file "typeload.ml", line 310, characters 6-58
Called from file "typeload.ml", line 328, characters 4-46
Called from file "typeload.ml", line 373, characters 11-32
Called from file "typeload.ml", line 697, characters 53-78
Called from file "typeload.ml", line 2967, characters 14-47
Called from file "list.ml", line 55, characters 20-23
Called from file "typeload.ml", line 2963, characters 11-395
Called from file "list.ml", line 73, characters 12-15
Called from file "typeload.ml", line 2941, characters 2-1023
Called from file "list.ml", line 73, characters 12-15
Called from file "typeload.ml", line 3151, characters 1-61
Called from file "typeload.ml", line 3268, characters 4-45
Called from file "typer.ml", line 4584, characters 7-62
Called from file "typer.ml", line 4661, characters 2-30
Called from file "typer.ml", line 4671, characters 17-40
Called from file "typer.ml", line 4871, characters 43-69
Called from file "typer.ml", line 4895, characters 8-41
Called from file "list.ml", line 73, characters 12-15
Called from file "main.ml", line 1491, characters 2-66
Called from file "main.ml", line 637, characters 3-11
Called from file "main.ml", line 1743, characters 1-35

All ideas and suggestions were welcome. :)

thx, 
Laurent

Gama11

unread,
Apr 21, 2016, 2:03:00 PM4/21/16
to Haxe
That sounds like a Haxe bug. I recommend checking if the problem still exists on the dev branch using a nightly build, and if so, open an issue on the repo (see https://github.com/HaxeFoundation/haxe/blob/development/CONTRIBUTING.md#things-to-check-beforewhile-filing-an-issue). 

Laurent Deketelaere

unread,
Apr 25, 2016, 2:53:57 AM4/25/16
to Haxe

Laurent Deketelaere

unread,
Apr 28, 2016, 3:11:43 AM4/28/16
to Haxe
Is there a SWF specification specialist in the room? :)
I try to find a way to get class informations that breaks haxe compilation : https://github.com/HaxeFoundation/haxe/issues/5161#issuecomment-215084612 

thx, 
Laurent
Reply all
Reply to author
Forward
0 new messages