Skip to content

Crash when accessing the object without initialized in native. #314

@Kray-G

Description

@Kray-G

Crash with the code below.

var mem = [];
for (var i = 0; i < 10; ++i) {
    mem[i] = i;
}

native func0(n:int):obj {
    var r:int[];
    for (var i = 0; i < n; ++i) {
        r[i] = mem[i];
    }
    return r;
}

var res = func0(10);
System.println(res);

Besides, an initializer cannot be accepted in compiler.

native f() {
    var a:int[] = [];
}
// Error: Not supported operation in native function near the <(unknown)>:2

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions