[compiler-rt] 76248da - [compiler-rt] [NSan] leave BufferedStackTrace uninit

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 15:19:51 PDT 2024


Author: Florian Mayer
Date: 2024-08-07T15:19:27-07:00
New Revision: 76248da8af6cf4b5968e79452e5fef9f5eaaafa5

URL: https://github.com/llvm/llvm-project/commit/76248da8af6cf4b5968e79452e5fef9f5eaaafa5
DIFF: https://github.com/llvm/llvm-project/commit/76248da8af6cf4b5968e79452e5fef9f5eaaafa5.diff

LOG: [compiler-rt] [NSan] leave BufferedStackTrace uninit

Otherwise we have to memset 2040 bytes (255 * 8) for each call

Pull Request: https://github.com/llvm/llvm-project/pull/102254

Added: 
    

Modified: 
    compiler-rt/lib/nsan/nsan.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/nsan/nsan.cpp b/compiler-rt/lib/nsan/nsan.cpp
index 568a1b3a655753..197003dc5cfee9 100644
--- a/compiler-rt/lib/nsan/nsan.cpp
+++ b/compiler-rt/lib/nsan/nsan.cpp
@@ -470,7 +470,7 @@ int32_t checkFT(const FT value, ShadowFT Shadow, CheckTypeT CheckType,
 
   if (!flags().disable_warnings) {
     GET_CALLER_PC_BP;
-    BufferedStackTrace stack;
+    UNINITIALIZED BufferedStackTrace stack;
     stack.Unwind(pc, bp, nullptr, false);
     if (GetSuppressionForStack(&stack, CheckKind::Consistency)) {
       // FIXME: optionally print.
@@ -637,7 +637,7 @@ void fCmpFailFT(const FT Lhs, const FT Rhs, ShadowFT LhsShadow,
   }
 
   GET_CALLER_PC_BP;
-  BufferedStackTrace stack;
+  UNINITIALIZED BufferedStackTrace stack;
   stack.Unwind(pc, bp, nullptr, false);
 
   if (GetSuppressionForStack(&stack, CheckKind::Fcmp)) {


        


More information about the llvm-commits mailing list