-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
symtable_handle_namedexpr does not adjust correctly the recursion level #82128
Comments
The symtable_handle_namedexpr function does not adjust correctly the recursion level when exiting (also, is actually not returning anything in a function defined as non-void but the return value is not used so is not technically undefined behavior). |
Reviewing the PR post-merge, I'm pretty sure this has introduced a double-decrement bug due to the original code being hard to read (the error cases did the decrement inside the helper function, while the success case did it in the calling function). #15593 builds on your PR by removing the recursion counter adjustments from inside the helper function, leaving only the ones in the calling function. |
Thank you very much Nick for correcting this! |
Reviewing all the code that touches recursion_depth (both in the symtable and in the thread state), I'm not seeing any sanity checks that ensure our increments and decrements *balance*. So I'm going to add one to PySymTable_BuildObject. |
We never actually coded a reproducer for this, but if we had, it would have been a crash bug. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
__annotate__
method for dataclasses frommake_dataclass
#122262The text was updated successfully, but these errors were encountered: