Compiler transforms to:
: The stack is unwound again. For each frame between the throw site and the catch frame, the personality routine calls destructors for local objects ( _UA_CLEANUP_PHASE ). Finally, control jumps to the catch block. c++ runtime
When dynamic_cast<B*>(a_ptr) is performed, the runtime reads the vtable of the object to obtain the type_info of the most derived type and checks if it derives from B . Compiler transforms to: : The stack is unwound again
static Logger& getLogger() static Logger instance; // thread‑safe initialization return instance; (a_ptr) is performed
done: return instance_memory;
(simplified for a class hierarchy A <- B ):