From 51500a1d7096395be9162599fae647ec121db91d Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Thu, 8 Apr 2021 09:12:08 +0200 Subject: Fixed UB in `spawn_at` --- src/tq.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/tq.rs') diff --git a/src/tq.rs b/src/tq.rs index 3864025..985e0f8 100644 --- a/src/tq.rs +++ b/src/tq.rs @@ -42,7 +42,7 @@ where nr: NotReady, enable_interrupt: F1, pend_handler: F2, - mono: &mut Mono, + mono: Option<&mut Mono>, ) where F1: FnOnce(), F2: FnOnce(), @@ -57,7 +57,9 @@ where if if_heap_max_greater_than_nr { if Mono::DISABLE_INTERRUPT_ON_EMPTY_QUEUE && self.0.is_empty() { - mono.enable_timer(); + if let Some(mono) = mono { + mono.enable_timer(); + } enable_interrupt(); } -- cgit v1.2.3