[compiler-rt] [scudo] Convert assert to CHECK macro. (PR #67184)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 22 12:29:17 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

<details>
<summary>Changes</summary>

This code is only for riscv, but use the CHECK macro to avoid unused parameters problems if assert is not defined.

---
Full diff: https://github.com/llvm/llvm-project/pull/67184.diff


1 Files Affected:

- (modified) compiler-rt/lib/scudo/standalone/tests/combined_test.cpp (+2-2) 


``````````diff
diff --git a/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp b/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
index f00d475148e8dcd..1143aaab8371d37 100644
--- a/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
+++ b/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
@@ -106,8 +106,8 @@ struct TestAllocatorStorage {
 
   // To alleviate some problem, let's skip the thread safety analysis here.
   static void *get(size_t size) NO_THREAD_SAFETY_ANALYSIS {
-    assert(size <= kMaxSize &&
-           "Allocation size doesn't fit in the allocator storage");
+    CHECK(size <= kMaxSize &&
+          "Allocation size doesn't fit in the allocator storage");
     M.lock();
     return AllocatorStorage;
   }

``````````

</details>


https://github.com/llvm/llvm-project/pull/67184


More information about the llvm-commits mailing list