[pypy-svn] r70701 - pypy/branch/cli-jit/pypy/jit/metainterp

antocuni at codespeak.net antocuni at codespeak.net
Tue Jan 19 14:10:31 CET 2010


Author: antocuni
Date: Tue Jan 19 14:10:31 2010
New Revision: 70701

Modified:
   pypy/branch/cli-jit/pypy/jit/metainterp/typesystem.py
Log:
don't crash if obj is null


Modified: pypy/branch/cli-jit/pypy/jit/metainterp/typesystem.py
==============================================================================
--- pypy/branch/cli-jit/pypy/jit/metainterp/typesystem.py	(original)
+++ pypy/branch/cli-jit/pypy/jit/metainterp/typesystem.py	Tue Jan 19 14:10:31 2010
@@ -187,7 +187,10 @@
 
     def cls_of_box(self, cpu, box):
         obj = box.getref(ootype.ROOT)
-        oocls = ootype.classof(obj)
+        if not obj:
+            oocls = ootype.runtimeClass(ootype.ROOT)
+        else:
+            oocls = ootype.classof(obj)
         return history.ConstObj(ootype.cast_to_object(oocls))
 
     def subclassOf(self, cpu, clsbox1, clsbox2):



More information about the Pypy-commit mailing list