In the course of adding some new code I came across a debug output message before an assert that was extremely unhelpful. If I incorrectly try to delete a Value object that still has uses in a debug build, an debug message is printed just before an assertion that says it is telling me where the value is still being used but actually just tries to print the value itself multiple times, which in my case was crashing because the Value was already partially destructed.
It looked like a pretty simple and obvious fix and I was just going to go ahead and commit it, but when I looked at the revision history I saw that the current behavior has been in place since 2002. So I thought maybe it would be a good idea to get a reality check and make sure I wasn’t being an idiot in some way.
Can someone give me a second opinion?
Here’s the change I am proposing:
Index: lib/IR/Value.cpp