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

Method typecheck_special

cranelift/codegen/src/verifier/mod.rs:1768–1787  ·  view source on GitHub ↗

Check special-purpose type constraints that can't be expressed in the normal opcode constraints.

(&self, inst: Inst, errors: &mut VerifierErrors)

Source from the content-addressed store, hash-verified

1766 // Check special-purpose type constraints that can't be expressed in the normal opcode
1767 // constraints.
1768 fn typecheck_special(&self, inst: Inst, errors: &mut VerifierErrors) -> VerifierStepResult {
1769 match self.func.dfg.insts[inst] {
1770 ir::InstructionData::UnaryGlobalValue { global_value, .. } => {
1771 if let Some(isa) = self.isa {
1772 let inst_type = self.func.dfg.value_type(self.func.dfg.first_result(inst));
1773 let global_type = self.func.global_values[global_value].global_type(isa);
1774 if inst_type != global_type {
1775 return errors.nonfatal((
1776 inst, self.context(inst),
1777 format!(
1778 "global_value instruction with type {inst_type} references global value with type {global_type}"
1779 )),
1780 );
1781 }
1782 }
1783 }
1784 _ => {}
1785 }
1786 Ok(())
1787 }
1788
1789 fn cfg_integrity(
1790 &self,

Callers 1

typecheckMethod · 0.80

Calls 6

OkFunction · 0.85
first_resultMethod · 0.80
global_typeMethod · 0.80
nonfatalMethod · 0.80
value_typeMethod · 0.45
contextMethod · 0.45

Tested by

no test coverage detected