Skip to content

[GC] incorrect memory management for call_indirect builtin #2923

Closed
@HerrCai0907

Description

@HerrCai0907

Bug description

call_indirect does not handle its arguments which are GC managed object

Steps to reproduce

class A {
  v: i32 = 10;
}

class B {
  v: i32 = 20;
}

function foo(a: A): void {
  __collect(); // force trigger GC
  let b = new B();
  trace("foo", 1, a.v);
}

export function _start(): void {
  call_indirect(foo.index, new A());
}
foo 20

AssemblyScript version

all

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions