@@ -126,17 +126,16 @@ impl<'store, 'stack> Executor<'store, 'stack> {
126126 /// or after all state mutations including increasing instruction pointer
127127 #[ must_use = "If this returns ControlFlow::Break, the caller should propagate it" ]
128128 fn check_should_suspend ( & mut self ) -> ControlFlow < ReasonToBreak > {
129- if let Some ( flag) = & self . store . suspend_cond . suspend_flag {
130- if flag. load ( core:: sync:: atomic:: Ordering :: Acquire ) {
131- return ReasonToBreak :: Suspended ( SuspendReason :: SuspendedFlag , None ) . into ( ) ;
132- }
129+ if let Some ( flag) = & self . store . suspend_cond . suspend_flag
130+ && flag. load ( core:: sync:: atomic:: Ordering :: Acquire ) {
131+ return ReasonToBreak :: Suspended ( SuspendReason :: SuspendedFlag , None ) . into ( ) ;
132+
133133 }
134134
135135 #[ cfg( feature = "std" ) ]
136- if let Some ( when) = & self . store . suspend_cond . timeout_instant {
137- if crate :: std:: time:: Instant :: now ( ) >= * when {
138- return ReasonToBreak :: Suspended ( SuspendReason :: SuspendedEpoch , None ) . into ( ) ;
139- }
136+ if let Some ( when) = & self . store . suspend_cond . timeout_instant
137+ && crate :: std:: time:: Instant :: now ( ) >= * when {
138+ return ReasonToBreak :: Suspended ( SuspendReason :: SuspendedEpoch , None ) . into ( ) ;
140139 }
141140
142141 if let Some ( mut cb) = self . store . suspend_cond . suspend_cb . take ( ) {
@@ -879,7 +878,7 @@ impl<'store, 'stack> Executor<'store, 'stack> {
879878 }
880879 }
881880 fn exec_call_direct < const IS_RETURN_CALL : bool > ( & mut self , v : u32 ) -> ControlFlow < ReasonToBreak > {
882- self . check_should_suspend ( ) ; // don't commit to function if we should be stopping now
881+ self . check_should_suspend ( ) ? ; // don't commit to function if we should be stopping now
883882 let func_inst = self . store . get_func ( self . module . resolve_func_addr ( v) ) ;
884883 match func_inst. func . clone ( ) {
885884 crate :: Function :: Wasm ( wasm_func) => self . exec_call :: < IS_RETURN_CALL > ( wasm_func, func_inst. owner ) ,
0 commit comments