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

Method verify_signatures

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

Source from the content-addressed store, hash-verified

2094 }
2095
2096 fn verify_signatures(&self, errors: &mut VerifierErrors) -> VerifierStepResult {
2097 // Verify this function's own signature.
2098 self.verify_signature(&self.func.signature, AnyEntity::Function, errors)?;
2099 // Verify signatures referenced by any extfunc, using that
2100 // extfunc as the entity to which to attach the error.
2101 for (func, funcdata) in &self.func.dfg.ext_funcs {
2102 // Non-contiguous func entities result in placeholders
2103 // with invalid signatures; skip them.
2104 if !funcdata.signature.is_reserved_value() {
2105 self.verify_signature(&self.func.dfg.signatures[funcdata.signature], func, errors)?;
2106 }
2107 }
2108 // Verify all signatures, including those only used by
2109 // e.g. indirect calls. Technically this re-verifies
2110 // signatures verified above but we want the first pass to
2111 // attach errors to funcrefs and we also need to verify all
2112 // defined signatures.
2113 for (sig, sigdata) in &self.func.dfg.signatures {
2114 self.verify_signature(sigdata, sig, errors)?;
2115 }
2116 Ok(())
2117 }
2118
2119 pub fn run(&self, errors: &mut VerifierErrors) -> VerifierStepResult {
2120 self.verify_global_values(errors)?;

Callers 1

runMethod · 0.80

Calls 3

OkFunction · 0.85
verify_signatureMethod · 0.80
is_reserved_valueMethod · 0.45

Tested by

no test coverage detected