MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / handle_unreachable_end

Method handle_unreachable_end

winch/codegen/src/codegen/mod.rs:296–314  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

294 }
295
296 pub fn handle_unreachable_end(&mut self) -> Result<()> {
297 let mut frame = self.pop_control_frame()?;
298 // We just popped the outermost block.
299 let is_outermost = self.control_frames.len() == 0;
300
301 if frame.is_next_sequence_reachable() {
302 self.context.reachable = true;
303 frame.ensure_stack_state(self.masm, &mut self.context)?;
304 frame.bind_end(self.masm, &mut self.context)
305 } else if is_outermost {
306 // If we reach the end of the function in an unreachable
307 // state, perform the necessary cleanup to leave the stack
308 // and SP in the expected state. The compiler can enter
309 // in this state through an infinite loop.
310 frame.ensure_stack_state(self.masm, &mut self.context)
311 } else {
312 Ok(())
313 }
314 }
315
316 fn emit_body(
317 &mut self,

Callers 1

visit_endMethod · 0.80

Calls 6

OkFunction · 0.85
pop_control_frameMethod · 0.80
ensure_stack_stateMethod · 0.80
bind_endMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected