From d17eade22ab9a65144a2bbd538f47924eed6b87d Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Wed, 21 Feb 2024 14:28:34 -0800 Subject: [PATCH] Do not call disable / enable on null depot (#82542) depot can be null if allocation_ring_buffer_size=0 --- compiler-rt/lib/scudo/standalone/combined.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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();