[NFC] [hwasan] move prints closer together.
authorFlorian Mayer <fmayer@google.com>
Wed, 8 Sep 2021 15:32:23 +0000 (16:32 +0100)
committerFlorian Mayer <fmayer@google.com>
Thu, 9 Sep 2021 12:39:11 +0000 (13:39 +0100)
this makes the code slightly more readable.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D109442

compiler-rt/lib/hwasan/hwasan_report.cpp

index 5beb25c..b5dd0cc 100644 (file)
@@ -681,11 +681,11 @@ void ReportTagMismatch(StackTrace *stack, uptr tagged_addr, uptr access_size,
       GetCurrentThread()->stack_allocations());
 
   Decorator d;
-  Printf("%s", d.Error());
   uptr untagged_addr = UntagAddr(tagged_addr);
   // TODO: when possible, try to print heap-use-after-free, etc.
   const char *bug_type = "tag-mismatch";
   uptr pc = GetTopPc(stack);
+  Printf("%s", d.Error());
   Report("ERROR: %s: %s on address %p at pc %p\n", SanitizerToolName, bug_type,
          untagged_addr, pc);