mirror of
https://github.com/python/cpython.git
synced 2026-04-20 19:01:14 +00:00
gh-109496: Detect Py_DECREF() after dealloc in debug mode (GH-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.
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| __main__.py | ||
| check_config.py | ||
| test_abstract.py | ||
| test_codecs.py | ||
| test_dict.py | ||
| test_eval_code_ex.py | ||
| test_exceptions.py | ||
| test_getargs.py | ||
| test_immortal.py | ||
| test_long.py | ||
| test_mem.py | ||
| test_misc.py | ||
| test_structmembers.py | ||
| test_unicode.py | ||
| test_watchers.py | ||