]> granicus.if.org Git - python/commit
bpo-37947: Avoid double-decrement in symtable recursion counting (GH-15593)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 29 Aug 2019 13:46:20 +0000 (06:46 -0700)
committerGitHub <noreply@github.com>
Thu, 29 Aug 2019 13:46:20 +0000 (06:46 -0700)
commit384c6d72d9a12764282ccc2d3935232a34a7cfbe
tree3f1aed8621f2bb32ca3d0fe427eeae00ffb8bd7c
parentc71ae1a45bd6e6d0f5aebc470b35f5a7dc0d8078
bpo-37947: Avoid double-decrement in symtable recursion counting (GH-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 06145230c833c3db5dab8858e11bcd550a37c57f)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
Python/symtable.c