[Python-checkins] cpython: Try to fix crash on x86 OpenIndiana buildbot.

antoine.pitrou python-checkins at python.org
Sun Jun 24 00:46:33 CEST 2012


http://hg.python.org/cpython/rev/33737210c906
changeset:   77659:33737210c906
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Sun Jun 24 00:42:59 2012 +0200
summary:
  Try to fix crash on x86 OpenIndiana buildbot.

files:
  Objects/typeobject.c |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/Objects/typeobject.c b/Objects/typeobject.c
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2396,6 +2396,8 @@
     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 @@
 
     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)) {

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list