devosoft / Empirical

A library of tools for scientific software development, with emphasis on also being able to build web interfaces using Emscripten.
Other
86 stars 38 forks source link

Fix multiple inheritance in mem tracking by dynamic casting pointers to `void*` #477

Open naalit opened 1 year ago

naalit commented 1 year ago

Fixes #476 (hopefully, unless I missed something) by inserting dynamic_cast<void*>() everywhere a pointer of non-void* type is passed to the pointer tracker within Ptr.

mercere99 commented 1 year ago

Looks like tests are failing. Looking more into dynamic_cast, it apparently ONLY works with polymorphic types, so it won't easily solve the problem here. We need to wrap all of the conversions in some type traits tests to make sure they are polymorphic before we try to resolve them. I'll look into it some more (unless you have time to first) and try to get this resolved.