From 60c1990f4aeb68743cb40bad5157a5ea7547287d Mon Sep 17 00:00:00 2001 From: Addison Crump Date: Tue, 6 Jun 2023 23:43:41 +0200 Subject: [PATCH] Make it possible to escape from simple event restarter (#1303) --- libafl/src/events/simple.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libafl/src/events/simple.rs b/libafl/src/events/simple.rs index 71145e59be..e6fe52b309 100644 --- a/libafl/src/events/simple.rs +++ b/libafl/src/events/simple.rs @@ -506,6 +506,10 @@ where compiler_fence(Ordering::SeqCst); + if staterestorer.wants_to_exit() { + return Err(Error::shutting_down()); + } + #[allow(clippy::manual_assert)] if !staterestorer.has_content() { #[cfg(unix)]