-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-37947: Avoid double-decrement in symtable recursion counting #15593
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
bpo-37947: Avoid double-decrement in symtable recursion counting #15593
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you for correcting this!
I think I've found a good spot to add a sanity check that will make the test cases fail if a PR gets this accounting wrong - building that now (and I'll test it out by partially reverting the previous change). |
Neat:
(This is with |
Thanks @ncoghlan for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
GH-15594 is a backport of this pull request to the 3.8 branch. |
…honGH-15593) With `symtable_visit_expr` now correctly adjusting the recursion depth for named expressions, `symtable_handle_namedexpr` should be leaving it alone. Also adds a new check to `PySymtable_BuildObject` that raises `SystemError` if a successful first symbol analysis pass fails to keep the stack depth accounting clean. (cherry picked from commit 0614523) Co-authored-by: Nick Coghlan <[email protected]>
…15593) With `symtable_visit_expr` now correctly adjusting the recursion depth for named expressions, `symtable_handle_namedexpr` should be leaving it alone. Also adds a new check to `PySymtable_BuildObject` that raises `SystemError` if a successful first symbol analysis pass fails to keep the stack depth accounting clean. (cherry picked from commit 0614523) Co-authored-by: Nick Coghlan <[email protected]>
…honGH-15593) With `symtable_visit_expr` now correctly adjusting the recursion depth for named expressions, `symtable_handle_namedexpr` should be leaving it alone. Also adds a new check to `PySymtable_BuildObject` that raises `SystemError` if a successful first symbol analysis pass fails to keep the stack depth accounting clean.
…honGH-15593) With `symtable_visit_expr` now correctly adjusting the recursion depth for named expressions, `symtable_handle_namedexpr` should be leaving it alone. Also adds a new check to `PySymtable_BuildObject` that raises `SystemError` if a successful first symbol analysis pass fails to keep the stack depth accounting clean.
…honGH-15593) With `symtable_visit_expr` now correctly adjusting the recursion depth for named expressions, `symtable_handle_namedexpr` should be leaving it alone. Also adds a new check to `PySymtable_BuildObject` that raises `SystemError` if a successful first symbol analysis pass fails to keep the stack depth accounting clean.
With
symtable_visit_expr
now correctly adjusting the recursion depth for namedexpressions,
symtable_handle_namedexpr
should be leaving it alone.https://bugs.python.org/issue37947