[compiler-rt] 99ec78c - [scudo] Fix use of ScopedDisableMemoryTagChecks in test

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 23 23:57:29 PDT 2021


Author: Vitaly Buka
Date: 2021-06-23T23:57:17-07:00
New Revision: 99ec78c0feded25a2b01dd5ae822b37a70b63c17

URL: https://github.com/llvm/llvm-project/commit/99ec78c0feded25a2b01dd5ae822b37a70b63c17
DIFF: https://github.com/llvm/llvm-project/commit/99ec78c0feded25a2b01dd5ae822b37a70b63c17.diff

LOG: [scudo] Fix use of ScopedDisableMemoryTagChecks in test

Added: 
    

Modified: 
    compiler-rt/lib/scudo/standalone/tests/wrappers_cpp_test.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/scudo/standalone/tests/wrappers_cpp_test.cpp b/compiler-rt/lib/scudo/standalone/tests/wrappers_cpp_test.cpp
index 64a0917d4773..24fbf277e032 100644
--- a/compiler-rt/lib/scudo/standalone/tests/wrappers_cpp_test.cpp
+++ b/compiler-rt/lib/scudo/standalone/tests/wrappers_cpp_test.cpp
@@ -11,6 +11,7 @@
 
 #include <atomic>
 #include <condition_variable>
+#include <memory>
 #include <mutex>
 #include <thread>
 #include <vector>
@@ -111,7 +112,9 @@ TEST(ScudoWrappersCppTest, ThreadedNew) {
 #if !SCUDO_ANDROID
   // TODO: Investigate why libc sometimes crashes with tag missmatch in
   // __pthread_clockjoin_ex.
-  scudo::ScopedDisableMemoryTagChecks NoTags;
+  std::unique_ptr<scudo::ScopedDisableMemoryTagChecks> NoTags;
+  if (scudo::systemSupportsMemoryTagging())
+    NoTags = std::make_unique<scudo::ScopedDisableMemoryTagChecks>();
 #endif
   Ready = false;
   std::thread Threads[32];


        


More information about the llvm-commits mailing list