Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 66a3a7e

Browse files
committed
Try to fix crash on x86 OpenIndiana buildbot.
1 parent 1351ca6 commit 66a3a7e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Objects/typeobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2396,6 +2396,8 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases)
23962396
if (res == NULL)
23972397
return NULL;
23982398
type = &res->ht_type;
2399+
/* The flags must be initialized early, before the GC traverses us */
2400+
type->tp_flags = spec->flags | Py_TPFLAGS_HEAPTYPE;
23992401
res->ht_name = PyUnicode_FromString(s);
24002402
if (!res->ht_name)
24012403
goto fail;
@@ -2450,7 +2452,6 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases)
24502452

24512453
type->tp_basicsize = spec->basicsize;
24522454
type->tp_itemsize = spec->itemsize;
2453-
type->tp_flags = spec->flags | Py_TPFLAGS_HEAPTYPE;
24542455

24552456
for (slot = spec->slots; slot->slot; slot++) {
24562457
if (slot->slot >= Py_ARRAY_LENGTH(slotoffsets)) {

0 commit comments

Comments
 (0)