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

Method instruction_integrity

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

Source from the content-addressed store, hash-verified

493 }
494
495 fn instruction_integrity(&self, inst: Inst, errors: &mut VerifierErrors) -> VerifierStepResult {
496 let inst_data = &self.func.dfg.insts[inst];
497 let dfg = &self.func.dfg;
498
499 // The instruction format matches the opcode
500 if inst_data.opcode().format() != InstructionFormat::from(inst_data) {
501 return errors.fatal((
502 inst,
503 self.context(inst),
504 "instruction opcode doesn't match instruction format",
505 ));
506 }
507
508 let expected_num_results = dfg.num_expected_results_for_verifier(inst);
509
510 // All result values for multi-valued instructions are created
511 let got_results = dfg.inst_results(inst).len();
512 if got_results != expected_num_results {
513 return errors.fatal((
514 inst,
515 self.context(inst),
516 format!("expected {expected_num_results} result values, found {got_results}"),
517 ));
518 }
519
520 self.verify_entity_references(inst, errors)
521 }
522
523 fn verify_entity_references(
524 &self,

Callers 1

runMethod · 0.80

Calls 9

fromFunction · 0.85
fatalMethod · 0.80
formatMethod · 0.45
opcodeMethod · 0.45
contextMethod · 0.45
lenMethod · 0.45
inst_resultsMethod · 0.45

Tested by

no test coverage detected