[pypy-svn] r28584 - pypy/dist/pypy/rpython/lltypesystem

arigo at codespeak.net arigo at codespeak.net
Fri Jun 9 14:37:28 CEST 2006


Author: arigo
Date: Fri Jun  9 14:37:26 2006
New Revision: 28584

Modified:
   pypy/dist/pypy/rpython/lltypesystem/rclass.py
Log:
(arre, arigo)
Fix for translator.c.test.test_lladdresses:test_flavored_malloc_stack.


Modified: pypy/dist/pypy/rpython/lltypesystem/rclass.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/rclass.py	(original)
+++ pypy/dist/pypy/rpython/lltypesystem/rclass.py	Fri Jun  9 14:37:26 2006
@@ -80,6 +80,11 @@
                     'raw': NONGCOBJECT,
                     'cpy': CPYOBJECT}
 
+LLFLAVOR = {'gc'   : 'gc',
+            'raw'  : 'raw',
+            'cpy'  : 'cpy',
+            'stack': 'raw',
+            }
 
 def cast_vtable_to_typeptr(vtable):
     while typeOf(vtable).TO != OBJECT_VTABLE:
@@ -298,9 +303,9 @@
     def __init__(self, rtyper, classdef, gcflavor='gc'):
         AbstractInstanceRepr.__init__(self, rtyper, classdef)
         if classdef is None:
-            self.object_type = OBJECT_BY_FLAVOR[gcflavor]
+            self.object_type = OBJECT_BY_FLAVOR[LLFLAVOR[gcflavor]]
         else:
-            ForwardRef = lltype.FORWARDREF_BY_FLAVOR[gcflavor]
+            ForwardRef = lltype.FORWARDREF_BY_FLAVOR[LLFLAVOR[gcflavor]]
             self.object_type = ForwardRef()
             
         self.prebuiltinstances = {}   # { id(x): (x, _ptr) }
@@ -344,7 +349,7 @@
                 fields['_wrapper_'] = 'wrapper', pyobj_repr
                 llfields.append(('wrapper', Ptr(PyObject)))
 
-            MkStruct = lltype.STRUCT_BY_FLAVOR[self.gcflavor]
+            MkStruct = lltype.STRUCT_BY_FLAVOR[LLFLAVOR[self.gcflavor]]
             object_type = MkStruct(self.classdef.name,
                                    ('super', self.rbase.object_type),
                                    *llfields)



More information about the Pypy-commit mailing list