aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/Python-ast.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-09-18 16:59:09 +0200
committerGitHub <noreply@github.com>2023-09-18 14:59:09 +0000
commit0bb0d88e2d4e300946e399e088e2ff60de2ccf8c (patch)
treee197a96bdf8c45937a2f839fd723a9bb58270c47 /Python/Python-ast.c
parentef659b96169888e52b6ff03ce28fffaaa8f76818 (diff)
downloadcpython-0bb0d88e2d4e300946e399e088e2ff60de2ccf8c.tar.gz
cpython-0bb0d88e2d4e300946e399e088e2ff60de2ccf8c.zip
gh-109496: Detect Py_DECREF() after dealloc in debug mode (#109539)
On a Python built in debug mode, Py_DECREF() now calls _Py_NegativeRefcount() if the object is a dangling pointer to deallocated memory: memory filled with 0xDD "dead byte" by the debug hook on memory allocators. The fix is to check the reference count *before* checking for _Py_IsImmortal(). Add test_decref_freed_object() to test_capi.test_misc.
Diffstat (limited to 'Python/Python-ast.c')
0 files changed, 0 insertions, 0 deletions