Why does [ #WinDbg ] show me the wrong function?

https://devblogs.microsoft.com/oldnewthing/20050322-00/?p=36113

TIL about COMDAT folding #compiler optimization!
Why does the debugger show me the wrong function? - The Old New Thing

Often you’ll be minding your own business debugging some code, and you decide to step into one function and the debugger shows that you’re in some other function. How did that happen? class Class1 { public: int *GetQ() { return q; } private: int *p; int *q; }; class Class2 { public: virtual int GetValue() […]

The Old New Thing