Commits

Antonio Cuni committed af03642

don't crash if obj is null

  • Participants
  • Parent commits 6b0ffab
  • Branches cli-jit

Comments (0)

Files changed (1)

pypy/jit/metainterp/typesystem.py

 
     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):