This is an archive of the discontinued LLVM Phabricator instance.

[hwasan] Fix top PC in error stack trace being off by 1 instruction.
ClosedPublic

Authored by eugenis on Oct 2 2018, 2:23 PM.

Details

Summary

GetStackTrace treats top PC as a return address from an error reporting
function, and adjusts it down by 1 instruction. This is not necessary in
a signal handler, so adjust PC up to compensate.

Diff Detail

Event Timeline

eugenis created this revision.Oct 2 2018, 2:23 PM

No test because I don't see a reliable way to trigger bad debug info for the previous instruction with a C/C++ source...
With this change, tests pass both before and after https://reviews.llvm.org/D52125

kcc accepted this revision.Oct 2 2018, 2:30 PM

LGTM

This revision is now accepted and ready to land.Oct 2 2018, 2:30 PM
vitalybuka accepted this revision.Oct 2 2018, 2:38 PM
This revision was automatically updated to reflect the committed changes.
Herald added a subscriber: Restricted Project. · View Herald TranscriptOct 2 2018, 2:53 PM