Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not call disable / enable on null depot #82542

Merged

Conversation

fmayer
Copy link
Contributor

@fmayer fmayer commented Feb 21, 2024

depot can be null if allocation_ring_buffer_size=0

Created using spr 1.3.4
@llvmbot
Copy link
Collaborator

llvmbot commented Feb 21, 2024

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

Author: Florian Mayer (fmayer)

Changes

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 --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();

@fmayer fmayer merged commit d17eade into main Feb 21, 2024
8 checks passed
@fmayer fmayer deleted the users/fmayer/sprdo-not-call-disable-enable-on-null-depot branch February 21, 2024 22:28
@dwblaikie
Copy link
Collaborator

reposting here rather than on the commit itself - should this change have test covergae? (or was it fixing a pre-existing/failing test?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants