Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual single inheritance fails #184

Open
sethrj opened this issue Aug 10, 2023 · 0 comments
Open

Virtual single inheritance fails #184

sethrj opened this issue Aug 10, 2023 · 0 comments
Labels

Comments

@sethrj
Copy link
Member

sethrj commented Aug 10, 2023

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...

@sethrj sethrj added the bug label Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant