[PATCH] D23873: Reify ErrorDeadlySignal
Filipe Cabecinhas via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 5 09:05:05 PDT 2016
filcab added a comment.
As for the NOLINT on the constructor: We have two Error* constructors doing that.
Do you want me to change them to parenthesized initialization too, so we don't need the NOLINT?
================
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,
----------------
vitalybuka wrote:
> Please move it back into cc file
I had taken it out because it's a simple function which would now be needed on two .cc files (for a while), and we don't really want to export the symbol.
Will put it back and export it, though.
================
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);
----------------
vitalybuka wrote:
> can you avoid nolint? maybe = {}
I can use parenthesis, but we might want to start thinking about updating the cpplint.py script. I guess there are newer versions that might be able to deal with this.
https://reviews.llvm.org/D23873
More information about the llvm-commits
mailing list