Skip to content

[mypyc] Fix reference count of spilled register in async def #18957

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

Merged
merged 6 commits into from
Apr 23, 2025

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Apr 23, 2025

Fix segfault caused by an extra decref related to SetAttr, which steals one of
the operands. Reference count of a stolen op source must not be decremented.

Add some tests that check that we don't leak memory in async functions.

JukkaL added 6 commits April 23, 2025 16:37
Fix segfault caused by an extra decref related to SetAttr, which steals one of
the operands. Reference count of a stolen op source must not be decremented.
The generated IR is pretty large, so manually verifying that reference
counting works is tedious. Instead, test that everything is freed at
runtime.
@JukkaL JukkaL merged commit 281ee30 into master Apr 23, 2025
12 checks passed
@JukkaL JukkaL deleted the yield-spillage-refcount-2 branch April 23, 2025 16:31
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.

2 participants