This is an archive of the discontinued LLVM Phabricator instance.

[NFC][Sanitizer] Add argument checks to BufferedStackTrace::Unwind* functions
ClosedPublic

Authored by yln on Feb 22 2019, 2:15 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

yln created this revision.Feb 22 2019, 2:15 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 22 2019, 2:16 PM
Herald added subscribers: llvm-commits, Restricted Project, jrtc27 and 3 others. · View Herald Transcript
vitalybuka accepted this revision.Feb 22 2019, 2:19 PM
This revision is now accepted and ready to land.Feb 22 2019, 2:19 PM
This revision was automatically updated to reflect the committed changes.
rtrieu added a subscriber: rtrieu.Feb 22 2019, 7:35 PM
rtrieu added inline comments.
compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.h
59–60

Is this suppose to be a run time check or a compile time check? The location of this assert makes it look like a run time check, only checking when the function is called, but that would require a regular assert instead of a static assert. If this is meant to be a compile time check as it is now, it would be clearer that it appears right after the two macros are defined rather than inside this function.

I think a run-time check is better to prevent compile errors from merely including this file without calling this function.

rtrieu added inline comments.Feb 22 2019, 9:50 PM
compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.h
59–60

I've removed this assert for the time being so it doesn't block anyone over the weekend. r354720

yln marked an inline comment as done.Feb 25 2019, 11:00 AM
yln added inline comments.
compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.h
59–60

This was meant to be a sanity check at compile time. I was completely unaware that there are platform/architectures that don't support any unwinder. How do we handle such cases?