[compiler-rt] 3120118 - [compiler-rt][hwasan] Add newline between record_addr lines on frame record dumps

Leonard Chan via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 14 17:13:56 PDT 2021


Author: Leonard Chan
Date: 2021-06-14T17:13:13-07:00
New Revision: 312011899ac3c48a77f4c5a069000f8aa93a8873

URL: https://github.com/llvm/llvm-project/commit/312011899ac3c48a77f4c5a069000f8aa93a8873
DIFF: https://github.com/llvm/llvm-project/commit/312011899ac3c48a77f4c5a069000f8aa93a8873.diff

LOG: [compiler-rt][hwasan] Add newline between record_addr lines on frame record dumps

If SymbolizePC failes, it's possible for the newline to not be emitted.

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

Added: 
    

Modified: 
    compiler-rt/lib/hwasan/hwasan_report.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/hwasan/hwasan_report.cpp b/compiler-rt/lib/hwasan/hwasan_report.cpp
index c02177993918d..b90a92a2202b8 100644
--- a/compiler-rt/lib/hwasan/hwasan_report.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_report.cpp
@@ -236,12 +236,12 @@ static void PrintStackAllocations(StackAllocationsRingBuffer *sa,
     frame_desc.append("  record_addr:0x%zx record:0x%zx",
                       reinterpret_cast<uptr>(record_addr), record);
     if (SymbolizedStack *frame = Symbolizer::GetOrInit()->SymbolizePC(pc)) {
-      RenderFrame(&frame_desc, " %F %L\n", 0, frame->info.address, &frame->info,
+      RenderFrame(&frame_desc, " %F %L", 0, frame->info.address, &frame->info,
                   common_flags()->symbolize_vs_style,
                   common_flags()->strip_path_prefix);
       frame->ClearAll();
     }
-    Printf("%s", frame_desc.data());
+    Printf("%s\n", frame_desc.data());
     frame_desc.clear();
   }
 }


        


More information about the llvm-commits mailing list