Skip to content
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

Fix GC leak in handling of JS_IteratorNext() result #301

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xeioex
Copy link
Contributor

@xeioex xeioex commented May 14, 2024

The code below triggers all the fixed code-paths.

function* f() {
   return [];
}

Array.from(f());
AggregateError(f());
Uint8Array.from(f());
Promise.race(f());
Promise.all(f());
Object.groupBy(f(), ({ type }) => type);
[...f()]

When a generator returned (not yielded) a reference-counted value, built-in
functions ignored it, and the value was not freed.

Fixes bellard#273
@xeioex xeioex force-pushed the fix-iterator-value-gc-leak branch from 4bc291b to cfed2ec Compare May 14, 2024 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant