[PATCH] D23873: Reify ErrorDeadlySignal
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 1 12:40:55 PDT 2016
vitalybuka requested changes to this revision.
This revision now requires changes to proceed.
================
Comment at: lib/asan/asan_errors.h:23
@@ -21,1 +22,3 @@
+static inline void PrintMemoryByte(InternalScopedString *str,
+ const char *before, u8 byte, bool in_shadow,
----------------
Please move it back into cc file
================
Comment at: lib/asan/asan_report.cc:324
@@ -348,39 +323,3 @@
ScopedInErrorReport in_report(/*report*/ nullptr, /*fatal*/ true);
- Decorator d;
- Printf("%s", d.Warning());
- Report(
- "ERROR: AddressSanitizer: %s on unknown address %p"
- " (pc %p bp %p sp %p T%d)\n",
- description, (void *)sig.addr, (void *)sig.pc, (void *)sig.bp,
- (void *)sig.sp, GetCurrentTidOrInvalid());
- Printf("%s", d.EndWarning());
- ScarinessScore SS;
- if (sig.pc < GetPageSizeCached())
- Report("Hint: pc points to the zero page.\n");
- if (sig.is_memory_access) {
- const char *access_type =
- sig.write_flag == SignalContext::WRITE
- ? "WRITE"
- : (sig.write_flag == SignalContext::READ ? "READ" : "UNKNOWN");
- Report("The signal is caused by a %s memory access.\n", access_type);
- if (sig.addr < GetPageSizeCached()) {
- Report("Hint: address points to the zero page.\n");
- SS.Scare(10, "null-deref");
- } else if (sig.addr == sig.pc) {
- SS.Scare(60, "wild-jump");
- } else if (sig.write_flag == SignalContext::WRITE) {
- SS.Scare(30, "wild-addr-write");
- } else if (sig.write_flag == SignalContext::READ) {
- SS.Scare(20, "wild-addr-read");
- } else {
- SS.Scare(25, "wild-addr");
- }
- } else {
- SS.Scare(10, "signal");
- }
- SS.Print();
- GET_STACK_TRACE_SIGNAL(sig);
- stack.Print();
- MaybeDumpInstructionBytes(sig.pc);
- Printf("AddressSanitizer can not provide additional info.\n");
- ReportErrorSummary(description, &stack);
+ ErrorDeadlySignal error{signo, sig, GetCurrentTidOrInvalid()}; // NOLINT
+ in_report.ReportError(error);
----------------
can you avoid nolint? maybe = {}
https://reviews.llvm.org/D23873
More information about the llvm-commits
mailing list