[compiler-rt] Do not call disable / enable on null depot (PR #82542)

via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 21 13:57:24 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

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

Author: Florian Mayer (fmayer)

<details>
<summary>Changes</summary>

depot can be null if allocation_ring_buffer_size=0


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


1 Files Affected:

- (modified) compiler-rt/lib/scudo/standalone/combined.h (+4-2) 


``````````diff
diff --git a/compiler-rt/lib/scudo/standalone/combined.h b/compiler-rt/lib/scudo/standalone/combined.h
index 080ba42ad44497..f3c3d757c9f128 100644
--- a/compiler-rt/lib/scudo/standalone/combined.h
+++ b/compiler-rt/lib/scudo/standalone/combined.h
@@ -688,12 +688,14 @@ class Allocator {
     Quarantine.disable();
     Primary.disable();
     Secondary.disable();
-    Depot->disable();
+    if (Depot)
+      Depot->disable();
   }
 
   void enable() NO_THREAD_SAFETY_ANALYSIS {
     initThreadMaybe();
-    Depot->enable();
+    if (Depot)
+      Depot->enable();
     Secondary.enable();
     Primary.enable();
     Quarantine.enable();

``````````

</details>


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


More information about the llvm-commits mailing list