This is an archive of the discontinued LLVM Phabricator instance.

[msan] Correct @LINE expression in obstack.cc
ClosedPublic

Authored by dsanders on Aug 15 2016, 9:00 AM.

Diff Detail

Event Timeline

dsanders updated this revision to Diff 68043.Aug 15 2016, 9:00 AM
dsanders retitled this revision from to [msan] Correct @LINE expression in obstack.cc.
dsanders updated this object.
dsanders added a subscriber: llvm-commits.

I've posted this one separately from D23512 because something very strange is going on in this test. Adding two blank lines causes the line number reported in the backtrace to change by 30. [[@LINE-3]] looks like the correct line to me since line 32 triggers the use of the uninitialised value but I can't explain why [[@LINE-30]] works when the two blank lines are removed. I've compared the output ELF both with and without the blank lines and I can't find any differences other than the line numbers being different by two in .debug_info and .debug_line which is to be expected.

That's because the check is on line 33, which [-30] equals to 3, which also happens to be first character of the string "30".

Does [[@LINE-3]] work if you remove the extra empty lines?

That's because the check is on line 33, which [-30] equals to 3, which also happens to be first character of the string "30".

Thanks. That also explains why adding two lines caused the test to fail since 35-30 is 5 which does not match.

Does [[@LINE-3]] work if you remove the extra empty lines?

Yes, [[@LINE-3]] works both with and without the extra lines.

eugenis accepted this revision.Aug 15 2016, 11:51 AM
eugenis added a reviewer: eugenis.

LGTM with whatever number of empty lines you prefer :)

This revision is now accepted and ready to land.Aug 15 2016, 11:51 AM
dsanders closed this revision.Aug 15 2016, 12:04 PM