Is there a way in Visual Studio 2010 to automatically catch a bug of calling a member function on a NULL object? Some flag perhaps, that puts an appropriate assertion at the begging of every member function?
The default behavior is to silently accept it and only crash when a field is accessed. In some cases however if is much later then the original error.
Edit: I know that calling member function on a NULL
pointer invokes undefined behavior. It is a bug in my code that I want to eradicate. I hope that Visual Studio has some non-standard tool that could assist me.