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

Function control_index

winch/codegen/src/codegen/mod.rs:2558–2562  ·  view source on GitHub ↗

Returns the index of the [`ControlStackFrame`] for the given depth.

(depth: u32, control_length: usize)

Source from the content-addressed store, hash-verified

2556/// Returns the index of the [`ControlStackFrame`] for the given
2557/// depth.
2558pub fn control_index(depth: u32, control_length: usize) -> Result<usize> {
2559 (control_length - 1)
2560 .checked_sub(depth as usize)
2561 .ok_or_else(|| format_err!(CodeGenError::control_frame_expected()))
2562}

Callers 3

visit_brMethod · 0.85
visit_br_ifMethod · 0.85
visit_br_tableMethod · 0.85

Calls 1

checked_subMethod · 0.80

Tested by

no test coverage detected