mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
GH-127705: better double free message. (GH-130785)
* Add location information when accessing already closed stackref * Add #def option to track closed stackrefs to provide precise information for use after free and double frees.
This commit is contained in:
parent
f33d21e24f
commit
78d50e91ff
5 changed files with 69 additions and 20 deletions
|
@ -2984,7 +2984,7 @@ _Py_Dealloc(PyObject *op)
|
|||
destructor dealloc = type->tp_dealloc;
|
||||
#ifdef Py_DEBUG
|
||||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
#ifndef Py_GIL_DISABLED
|
||||
#if !defined(Py_GIL_DISABLED) && !defined(Py_STACKREF_DEBUG)
|
||||
/* This assertion doesn't hold for the free-threading build, as
|
||||
* PyStackRef_CLOSE_SPECIALIZED is not implemented */
|
||||
assert(tstate->current_frame == NULL || tstate->current_frame->stackpointer != NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue