Commits

Armin Rigo  committed 1ab21f8

Make the crash clearer, e.g. if we compile old code which still uses
'_virtualizable2_'

  • Participants
  • Parent commits 5b2ef39

Comments (0)

Files changed (2)

File rpython/jit/metainterp/typesystem.py

         return FUNCTYPE, FUNCPTRTYPE
 
     def get_superclass(self, TYPE):
-        return lltype.Ptr(TYPE.TO._first_struct()[1])
+        SUPER = TYPE.TO._first_struct()[1]
+        if SUPER is None:
+            return None
+        return lltype.Ptr(SUPER)
 
     def cast_to_instance_maybe(self, TYPE, instance):
         return lltype.cast_pointer(TYPE, instance)

File rpython/jit/metainterp/virtualizable.py

         self.cpu = cpu
         self.BoxArray = cpu.ts.BoxRef
         #
+        VTYPEPTR1 = VTYPEPTR
         while 'virtualizable_accessor' not in deref(VTYPEPTR)._hints:
             VTYPEPTR = cpu.ts.get_superclass(VTYPEPTR)
+            assert VTYPEPTR is not None, (
+                "%r is listed in the jit driver's 'virtualizables', "
+                "but that class doesn't have a '_virtualizable_' attribute "
+                "(if it has _virtualizable2_, rename it to _virtualizable_)"
+                % (VTYPEPTR1,))
         self.VTYPEPTR = VTYPEPTR
         self.VTYPE = VTYPE = deref(VTYPEPTR)
         self.vable_token_descr = cpu.fielddescrof(VTYPE, 'vable_token')