mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
Issue #7466: segmentation fault when the garbage collector is called
in the middle of populating a tuple. Patch by Florent Xicluna. (note: no NEWS entry for trunk since the bug was introduced in 2.7/3.1)
This commit is contained in:
parent
9be87bc992
commit
c169c781a8
2 changed files with 5 additions and 1 deletions
|
@ -875,7 +875,8 @@ _PyTuple_Resize(PyObject **pv, Py_ssize_t newsize)
|
|||
|
||||
/* XXX UNREF/NEWREF interface should be more symmetrical */
|
||||
_Py_DEC_REFTOTAL;
|
||||
_PyObject_GC_UNTRACK(v);
|
||||
if (_PyObject_GC_IS_TRACKED(v))
|
||||
_PyObject_GC_UNTRACK(v);
|
||||
_Py_ForgetReference((PyObject *) v);
|
||||
/* DECREF items deleted by shrinkage */
|
||||
for (i = newsize; i < oldsize; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue