• Jason Rhinelander's avatar
    Track base class pointers of instances · 1f8a100d
    Jason Rhinelander authored
    This commits adds base class pointers of offset base classes (i.e. due
    to multiple inheritance) to `registered_instances` so that if such a
    pointer is returned we properly recognize it as an existing instance.
    
    Without this, returning a base class pointer will cast to the existing
    instance if the pointer happens to coincide with the instance pointer,
    but constructs a new instance (quite possibly with a segfault, if
    ownership is applied) for unequal base class pointers due to multiple
    inheritance.
    1f8a100d
test_multiple_inheritance.cpp 6.97 KB