[pypy-commit] pypy stmgc-static-barrier: Fix the test

arigo noreply at buildbot.pypy.org
Sat Aug 17 10:45:57 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-static-barrier
Changeset: r66177:cb4cc9552a90
Date: 2013-08-17 10:43 +0200
http://bitbucket.org/pypy/pypy/changeset/cb4cc9552a90/

Log:	Fix the test

diff --git a/rpython/translator/stm/writebarrier.py b/rpython/translator/stm/writebarrier.py
--- a/rpython/translator/stm/writebarrier.py
+++ b/rpython/translator/stm/writebarrier.py
@@ -199,12 +199,19 @@
                                 category[v] = 'Q'
                     else:
                         # the same, but only on objects of the right types
-                        types = set([entry[1] for entry in effectinfo])
+                        # -- we need to consider 'types' or any base type
+                        types = set()
+                        for entry in effectinfo:
+                            TYPE = entry[1].TO
+                            while TYPE is not None:
+                                types.add(TYPE)
+                                if not isinstance(TYPE, lltype.Struct):
+                                    break
+                                _, TYPE = TYPE._first_struct()
                         for v in category.keys():
-                            if v.concretetype in types and category[v] == 'R':
+                            if (v.concretetype.TO in types and
+                                   category[v] == 'R'):
                                 category[v] = 'Q'
-                        # XXX this is likely not general enough: we need
-                        # to consider 'types' or any base type
 
                 if op.opname in MALLOCS:
                     category[op.result] = 'W'


More information about the pypy-commit mailing list