[pypy-svn] r65118 - pypy/branch/pyjitpl5/pypy/rpython

antocuni at codespeak.net antocuni at codespeak.net
Wed May 6 20:28:36 CEST 2009


Author: antocuni
Date: Wed May  6 20:28:34 2009
New Revision: 65118

Modified:
   pypy/branch/pyjitpl5/pypy/rpython/rclass.py
Log:
don't crash if we try to use an UnboxedValue on ootype, but just ignore it.  This fixes jit/backend/cli/test_zrpy_basic.py



Modified: pypy/branch/pyjitpl5/pypy/rpython/rclass.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/rpython/rclass.py	(original)
+++ pypy/branch/pyjitpl5/pypy/rpython/rclass.py	Wed May  6 20:28:34 2009
@@ -55,10 +55,7 @@
         assert len(unboxed) == 0
         assert gcflavor == 'gc'
         return rtyper.type_system.rvirtualizable2.Virtualizable2InstanceRepr(rtyper, classdef)
-    elif len(unboxed) == 0:
-        return rtyper.type_system.rclass.InstanceRepr(rtyper, classdef, gcflavor)
-    else:
-        assert rtyper.type_system.name == 'lltypesystem'
+    elif len(unboxed) > 0 and rtyper.type_system.name == 'lltypesystem':
         # the UnboxedValue class and its parent classes need a
         # special repr for their instances
         if len(unboxed) != 1:
@@ -67,6 +64,8 @@
         assert gcflavor == 'gc'
         from pypy.rpython.lltypesystem import rtagged
         return rtagged.TaggedInstanceRepr(rtyper, classdef, unboxed[0])
+    else:
+        return rtyper.type_system.rclass.InstanceRepr(rtyper, classdef, gcflavor)
 
 
 class MissingRTypeAttribute(TyperError):



More information about the Pypy-commit mailing list