Bug 935778 - Part 0.7: Use dynamic_cast<void*> on polymorphic objects in order to get the correct identity pointer