(&self, inst: Inst, errors: &mut VerifierErrors)
| 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, |
no test coverage detected