Skip to content

Virtual single inheritance fails #184

@sethrj

Description

@sethrj

As noted in the code for #183 , virtual single inheritance is broken:

class A {
  public:
    virtual int foo() { return 1; }
};
class B : virtual public A {
};

If you create a class(B) :: b and call b%foo(), the proxy code for A%foo will be passed a pointer B*. However, the _swig_A_foo wrapper reinterpret-casts the pointer as A*. This is fine for regular classes where A* and B* have the same address, but not fine for virtual classes where the pointers have to be offset. Not sure what the right approach here is...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions