diff --git a/libafl/src/state/mod.rs b/libafl/src/state/mod.rs index 3710f356e7..9bd2af6992 100644 --- a/libafl/src/state/mod.rs +++ b/libafl/src/state/mod.rs @@ -556,13 +556,7 @@ impl HasCurrentStage for StdState { } fn clear_stage(&mut self) -> Result<(), Error> { - self.stage_idx_stack.pop(); - // ensure we are in the right frame - if self.stage_depth != self.stage_idx_stack.len() { - return Err(Error::illegal_state( - "we somehow cleared too many or too few states!", - )); - } + self.stage_idx_stack.truncate(self.stage_depth); Ok(()) }