Skip to content

GC Bug #2719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
HerrCai0907 opened this issue Jul 20, 2023 · 0 comments · Fixed by #2720
Closed

GC Bug #2719

HerrCai0907 opened this issue Jul 20, 2023 · 0 comments · Fixed by #2720
Labels

Comments

@HerrCai0907
Copy link
Member

Bug description

class T {
v: i32 = 0;
}

function f1(a: i32, t: T, b: i32): void {
  trace("f1", 1, t.v);
}

function f2(t: T): i32 {
  __collect();  // gc will recover the second argument T in f1
  let c = new T();
  c.v = 100;
  return 1;
}

export function _start(): void {
  f1(1, new T(), f2(new T()));
}

This code will output f1 100 instead of f1 0

Steps to reproduce

run those code

AssemblyScript version

0.25.2 - 0.27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant