Skip to content

gh-125723: Fix crash with f_locals when generator frame outlive their generator #126956

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

Conversation

efimov-mikhail
Copy link
Contributor

@efimov-mikhail efimov-mikhail commented Nov 18, 2024

It seems that this PR had a problem.
It provides incorrect clearing of generator frame locals without checking any another references on this frame.
In this PR we can see a more accurate way of clearing such a frame.

@efimov-mikhail
Copy link
Contributor Author

cc @ncoghlan

Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
Nice clean fix and thorough tests.

@efimov-mikhail
Copy link
Contributor Author

So, this PR can be merged? Or there's something I should improve?

@sobolevn
Copy link
Member

I am planning to merge this in a couple of days if no one has objections.

Copy link
Contributor

@ncoghlan ncoghlan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, too! Nice detective work, thanks. Minor typo fix suggestion in the NEWS entry.

@sobolevn sobolevn merged commit 8e20e42 into python:main Jan 22, 2025
41 checks passed
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.

5 participants