diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-06-23 22:42:59 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-06-23 22:42:59 (GMT) |
commit | 66a3a7ed107b8148d21d8d2e5cbf5d3940be8297 (patch) | |
tree | 02c467b872637bc9e7ee298b6c9203cfb8dc23dd /Objects | |
parent | 1351ca6e66abe2593687bb35235ad71cf6da66a1 (diff) | |
download | cpython-66a3a7ed107b8148d21d8d2e5cbf5d3940be8297.zip cpython-66a3a7ed107b8148d21d8d2e5cbf5d3940be8297.tar.gz cpython-66a3a7ed107b8148d21d8d2e5cbf5d3940be8297.tar.bz2 |
Try to fix crash on x86 OpenIndiana buildbot.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index dff47f3..2cc6eea 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)) { |