Skip to content

Fatal error: exception Out of memory when targeting Hashlink #9662

Description

@skial

It looks like two classes with duplicate private types causes this error when targeting hl. I've setup a repo with all the code and generated dump files.

// Main.hx
class Main {

    public static function main() {
        new Test1().test();
        new Test2().test();
    }

}
// Test1.hx
class Test1 {

    public function new() {}

    public function test() {
        var _foo:Foo = new FooLike();
    }

}
// Test2.hx
class Test2 {

    public function new() {}

    public function test() {
        var _foo:Foo = new FooLike();
    }

}

With both Test1.hx and Test2.hx having these two types at the end:

private typedef Foo = {
    function make<T>(v:T):Foo;
}

private class FooLike {
    public function new() {}
    public function make<T>(v:T):FooLike return this;
}

And the stack trace.

OCAMLRUNPARAM=b haxe build.hxml
Fatal error: exception Out of memory
Raised by primitive operation at file "pMap.ml", line 81, characters 20-27
Called from file "pMap.ml", line 122, characters 16-23
Called from file "_build/src/generators/hlcode.ml", line 386, characters 5-22
Called from file "array.ml", line 90, characters 31-48
Called from file "_build/src/generators/hlcode.ml", line 410, characters 2-41
Called from file "array.ml", line 90, characters 31-48
Called from file "_build/src/generators/hlcode.ml", line 408, characters 1-188
Called from file "_build/src/generators/genhl.ml", line 3628, characters 25-42
Called from file "_build/src/generators/genhl.ml", line 4074, characters 2-65
Called from file "_build/src/compiler/main.ml", line 343, characters 2-14
Called from file "_build/src/compiler/main.ml", line 1059, characters 25-62
Re-raised at file "_build/src/compiler/main.ml", line 1205, characters 2-11
Called from file "_build/src/compiler/main.ml", line 633, characters 3-11
Called from file "_build/src/compiler/main.ml", line 1220, characters 1-35

Metadata

Metadata

Assignees

Labels

bugplatform-hlEverything related to HashLink

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions