reset kill states when returning from an instance run, except yielding
yielding does not cause a kill state reset because the same guest
function may be resumed later on
@@ -954,10 +954,12 @@ impl Instance {
match st {
State::Running => {
let retval = self.ctx.get_untyped_retval();
+ self.kill_state = Arc::new(KillState::default());
self.state = State::Ready;
Ok(RunResult::Returned(retval))
}
State::Terminating { details, .. } => {
+ self.kill_state = Arc::new(KillState::default());
self.state = State::Terminated;
Err(Error::RuntimeTerminated(details))
}
@@ -979,6 +981,8 @@ impl Instance {
.module
.addr_details(details.rip_addr as *const c_void)?;
+ self.kill_state = Arc::new(KillState::default());
+
// fill the state back in with the updated details in case fatal handlers need it
self.state = State::Faulted {
details: details.clone(),
