chiark / gitweb /
src/class-layout-impl.lisp: Fix class pointers in secondary chains.
Consider:
[link = SodClass] class MyClass: SodClass { }
[metaclass = MyClass] class Foo: SodObject { }
GCC reports:
/tmp/mdw/t.c:258:33: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
/* _class = */ &Foo__classobj.obj.myclass,
^
/tmp/mdw/t.c:258:33: note: (near initialization for ‘Foo__vtable_obj.obj._class’)
What's going on here is that it's writing the wrong metaclass pointer
into the `_class' pointer on `Foo''s secondary `obj' chain.
Fix this by choosing, for each class pointer, the most specific
superclass of the overall metaclass that is (a) on the correct chain of
the metaclass, and (b) is a superclass of the metaclass of the most
specific class in the chain whose vtable we're writing. Whew!