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

Method verify_inst_result

cranelift/codegen/src/verifier/mod.rs:1095–1126  ·  view source on GitHub ↗
(
        &self,
        loc_inst: Inst,
        v: Value,
        errors: &mut VerifierErrors,
    )

Source from the content-addressed store, hash-verified

1093 }
1094
1095 fn verify_inst_result(
1096 &self,
1097 loc_inst: Inst,
1098 v: Value,
1099 errors: &mut VerifierErrors,
1100 ) -> VerifierStepResult {
1101 self.verify_value(loc_inst, v, errors)?;
1102
1103 match self.func.dfg.value_def(v) {
1104 ValueDef::Result(def_inst, _) => {
1105 if def_inst != loc_inst {
1106 errors.fatal((
1107 loc_inst,
1108 self.context(loc_inst),
1109 format!("instruction result {v} is not defined by the instruction"),
1110 ))
1111 } else {
1112 Ok(())
1113 }
1114 }
1115 ValueDef::Param(_, _) => errors.fatal((
1116 loc_inst,
1117 self.context(loc_inst),
1118 format!("instruction result {v} is not defined by the instruction"),
1119 )),
1120 ValueDef::Union(_, _) => errors.fatal((
1121 loc_inst,
1122 self.context(loc_inst),
1123 format!("instruction result {v} is a union node"),
1124 )),
1125 }
1126 }
1127
1128 fn verify_bitcast(
1129 &self,

Callers 1

Calls 5

OkFunction · 0.85
verify_valueMethod · 0.80
value_defMethod · 0.80
fatalMethod · 0.80
contextMethod · 0.45

Tested by

no test coverage detected