[compiler-rt] 6eaaf09 - [NFC][hwasan] Add a few const

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 21 14:57:29 PDT 2023


Author: Vitaly Buka
Date: 2023-09-21T14:57:16-07:00
New Revision: 6eaaf09168014bdce60d680f8c7db75dd48723be

URL: https://github.com/llvm/llvm-project/commit/6eaaf09168014bdce60d680f8c7db75dd48723be
DIFF: https://github.com/llvm/llvm-project/commit/6eaaf09168014bdce60d680f8c7db75dd48723be.diff

LOG: [NFC][hwasan] Add a few const

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/hwasan/hwasan_report.cpp b/compiler-rt/lib/hwasan/hwasan_report.cpp
index 096cc02a18c7b14..34d756c9d9ede62 100644
--- a/compiler-rt/lib/hwasan/hwasan_report.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_report.cpp
@@ -902,8 +902,8 @@ class TagMismatchReport : public BaseReport {
   ~TagMismatchReport();
 
  private:
-  bool is_store;
-  uptr *registers_frame;
+  const bool is_store;
+  const uptr *registers_frame;
 };
 
 TagMismatchReport::~TagMismatchReport() {
@@ -987,7 +987,7 @@ void ReportTagMismatch(StackTrace *stack, uptr tagged_addr, uptr access_size,
 
 // See the frame breakdown defined in __hwasan_tag_mismatch (from
 // hwasan_tag_mismatch_{aarch64,riscv64}.S).
-void ReportRegisters(uptr *frame, uptr pc) {
+void ReportRegisters(const uptr *frame, uptr pc) {
   Printf("Registers where the failure occurred (pc %p):\n", pc);
 
   // We explicitly print a single line (4 registers/line) each iteration to

diff  --git a/compiler-rt/lib/hwasan/hwasan_report.h b/compiler-rt/lib/hwasan/hwasan_report.h
index de86c38fc01f2d8..bb9492a18cf948b 100644
--- a/compiler-rt/lib/hwasan/hwasan_report.h
+++ b/compiler-rt/lib/hwasan/hwasan_report.h
@@ -26,7 +26,7 @@ void ReportTagMismatch(StackTrace *stack, uptr addr, uptr access_size,
 void ReportInvalidFree(StackTrace *stack, uptr addr);
 void ReportTailOverwritten(StackTrace *stack, uptr addr, uptr orig_size,
                            const u8 *expected);
-void ReportRegisters(uptr *registers_frame, uptr pc);
+void ReportRegisters(const uptr *registers_frame, uptr pc);
 void ReportAtExitStatistics();
 
 


        


More information about the llvm-commits mailing list