[compiler-rt] 58fdfe7 - [NFC][hwasan] More consts in BaseReport (#66682)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 20 20:56:34 PDT 2023


Author: Vitaly Buka
Date: 2023-09-20T20:56:21-07:00
New Revision: 58fdfe77efe06368c18292e3f55d7f9d24f4a35d

URL: https://github.com/llvm/llvm-project/commit/58fdfe77efe06368c18292e3f55d7f9d24f4a35d
DIFF: https://github.com/llvm/llvm-project/commit/58fdfe77efe06368c18292e3f55d7f9d24f4a35d.diff

LOG: [NFC][hwasan] More consts in BaseReport (#66682)

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 2a6055a49a706b7..ecc15b80af8ea77 100644
--- a/compiler-rt/lib/hwasan/hwasan_report.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_report.cpp
@@ -373,7 +373,7 @@ static void PrintTagsAroundAddr(tag_t *tag_ptr) {
       "description of short granule tags\n");
 }
 
-static uptr GetTopPc(StackTrace *stack) {
+static uptr GetTopPc(const StackTrace *stack) {
   return stack->size ? StackTrace::GetPreviousInstructionPc(stack->trace[0])
                      : 0;
 }
@@ -417,12 +417,12 @@ class BaseReport {
   void PrintAddressDescription() const;
   void PrintHeapOrGlobalCandidate() const;
 
-  ScopedReport scoped_report;
-  StackTrace *stack = nullptr;
-  uptr tagged_addr = 0;
-  uptr access_size = 0;
-  uptr untagged_addr = 0;
-  tag_t ptr_tag = 0;
+  const ScopedReport scoped_report;
+  const StackTrace *stack = nullptr;
+  const uptr tagged_addr = 0;
+  const uptr access_size = 0;
+  const uptr untagged_addr = 0;
+  const tag_t ptr_tag = 0;
 
   uptr stack_allocations_count = 0;
   SavedStackAllocations stack_allocations[16];
@@ -753,7 +753,7 @@ class TailOverwrittenReport : public BaseReport {
   ~TailOverwrittenReport();
 
  private:
-  uptr orig_size;
+  const uptr orig_size;
   const u8 *expected;
 };
 


        


More information about the llvm-commits mailing list