From: Antoine Pitrou Date: Sat, 23 Jun 2012 22:42:59 +0000 (+0200) Subject: Try to fix crash on x86 OpenIndiana buildbot. X-Git-Tag: v3.3.0b1~98 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=66a3a7ed107b8148d21d8d2e5cbf5d3940be8297;p=thirdparty%2FPython%2Fcpython.git Try to fix crash on x86 OpenIndiana buildbot. --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index dff47f371fa0..2cc6eea46547 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -2396,6 +2396,8 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases) if (res == NULL) return NULL; type = &res->ht_type; + /* The flags must be initialized early, before the GC traverses us */ + type->tp_flags = spec->flags | Py_TPFLAGS_HEAPTYPE; res->ht_name = PyUnicode_FromString(s); if (!res->ht_name) goto fail; @@ -2450,7 +2452,6 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases) type->tp_basicsize = spec->basicsize; type->tp_itemsize = spec->itemsize; - type->tp_flags = spec->flags | Py_TPFLAGS_HEAPTYPE; for (slot = spec->slots; slot->slot; slot++) { if (slot->slot >= Py_ARRAY_LENGTH(slotoffsets)) {