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

Method run

cranelift/codegen/src/verifier/mod.rs:2119–2152  ·  view source on GitHub ↗
(&self, errors: &mut VerifierErrors)

Source from the content-addressed store, hash-verified

2117 }
2118
2119 pub fn run(&self, errors: &mut VerifierErrors) -> VerifierStepResult {
2120 self.verify_global_values(errors)?;
2121 self.verify_alias_regions(errors)?;
2122 self.typecheck_entry_block_params(errors)?;
2123 self.check_entry_not_cold(errors)?;
2124 self.typecheck_function_signature(errors)?;
2125 self.verify_signatures(errors)?;
2126
2127 for block in self.func.layout.blocks() {
2128 if self.func.layout.first_inst(block).is_none() {
2129 return errors.fatal((block, format!("{block} cannot be empty")));
2130 }
2131 for inst in self.func.layout.block_insts(block) {
2132 crate::trace!("verifying {inst:?}: {}", self.func.dfg.display_inst(inst));
2133 self.block_integrity(block, inst, errors)?;
2134 self.instruction_integrity(inst, errors)?;
2135 self.typecheck(inst, errors)?;
2136 self.immediate_constraints(inst, errors)?;
2137 self.iconst_bounds(inst, errors)?;
2138 self.debug_tags(inst, errors)?;
2139 }
2140
2141 self.encodable_as_bb(block, errors)?;
2142 }
2143
2144 if !errors.is_empty() {
2145 log::warn!(
2146 "Found verifier errors in function:\n{}",
2147 pretty_verifier_error(self.func, None, errors.clone())
2148 );
2149 }
2150
2151 Ok(())
2152 }
2153}
2154
2155#[cfg(test)]

Callers 5

verify_functionFunction · 0.45
verify_contextFunction · 0.45
bad_instruction_formatFunction · 0.45
test_iconst_boundsFunction · 0.45
test_empty_blockFunction · 0.45

Calls 15

OkFunction · 0.85
verify_global_valuesMethod · 0.80
verify_alias_regionsMethod · 0.80
check_entry_not_coldMethod · 0.80
verify_signaturesMethod · 0.80
blocksMethod · 0.80
first_instMethod · 0.80
fatalMethod · 0.80
block_instsMethod · 0.80
block_integrityMethod · 0.80

Tested by 3

bad_instruction_formatFunction · 0.36
test_iconst_boundsFunction · 0.36
test_empty_blockFunction · 0.36