summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-12-12 19:13:08 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2009-12-12 19:13:08 (GMT)
commitc169c781a807e0d0e1463d510be9523b1d6c2689 (patch)
tree0a6385420fac9e485197648d07692bf7955b0baf /Objects
parent9be87bc992465abaa572f86fcf4e375192617a6f (diff)
downloadcpython-c169c781a807e0d0e1463d510be9523b1d6c2689.zip
cpython-c169c781a807e0d0e1463d510be9523b1d6c2689.tar.gz
cpython-c169c781a807e0d0e1463d510be9523b1d6c2689.tar.bz2
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)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/tupleobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 0a9c718..384b830 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -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++) {