You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@kripken and @sbc100 , I have created a new issue for this problem as I believe the root cause is not about pointer inequality. The issue here is that the pointer to the type info is duplicated and since dynamic_cast relies on pointer comparison, the dynamic_cast fails.
@kripken and @sbc100 , I have created a new issue for this problem as I believe the root cause is not about pointer inequality. The issue here is that the pointer to the type info is duplicated and since dynamic_cast relies on pointer comparison, the dynamic_cast fails.
emscripten/system/lib/libcxxabi/src/private_typeinfo.cpp
Line 78 in fc88744
The problem can be reproduced when we pass a derived pointer to a function in another module. The dynamic_cast fails in the other module.
main.cpp
`EMSCRIPTEN_KEEPALIVE extern "C"
void mainy(base * arg) {
derived * temp = dynamic_cast < derived * > (arg);
printf("temp:%p\n", temp);
}
extern "C" void sidey(base* arg);
int main() {
derived* temp = new derived();
printf("main: temp:%p\n", temp);
sidey(temp);
return 0;
}`
side.cpp
`EMSCRIPTEN_KEEPALIVE extern "C"
void sidey(base* arg) {
derived * temp1 = dynamic_cast < derived * > (arg);
printf("sidey: arg:%p temp1:%p\n", arg, temp1);
base* temp = new derived();
mainy(temp);
}`
The text was updated successfully, but these errors were encountered: