Replies: 1 comment
-
Just realized this is probably just not a supported scenario since there is no way to know what the real type of the object is... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Cast
is a class with multiple subclasses. It contains a pointerCast* parentCast
to refer to its parent (it's a hierarchical tree structure).For this field CppSharp generates the following code:
The
__GetOrCreateInstance
call is implemented as follows:So if
parentCast
contains a pointer to a subclass,Cast.SetupVTables
gets called with this pointer to a subclass. But if I understand correctly the result from the SetupVTables call is cached for the entire typeCast
. So now the cached vtables forCast
actually contain the vtables for the subclass, and if next I access a pointer to a different subclass the wrong vtables are loaded. Moreover, the same happens for all base classes since the base constructors were also called withskipVTables
false? Am I misunderstanding something? Am I doing something wrong here? Did I misconfigure something?Beta Was this translation helpful? Give feedback.
All reactions