(
&self,
inst: Inst,
opcode: Opcode,
constant: Constant,
errors: &mut VerifierErrors,
)
| 1165 | } |
| 1166 | |
| 1167 | fn verify_constant_size( |
| 1168 | &self, |
| 1169 | inst: Inst, |
| 1170 | opcode: Opcode, |
| 1171 | constant: Constant, |
| 1172 | errors: &mut VerifierErrors, |
| 1173 | ) -> VerifierStepResult { |
| 1174 | let type_size = match opcode { |
| 1175 | Opcode::F128const => types::F128.bytes(), |
| 1176 | Opcode::Vconst => self.func.dfg.ctrl_typevar(inst).bytes(), |
| 1177 | _ => unreachable!("unexpected opcode {opcode:?}"), |
| 1178 | } as usize; |
| 1179 | let constant_size = self.func.dfg.constants.get(constant).len(); |
| 1180 | if type_size != constant_size { |
| 1181 | errors.fatal(( |
| 1182 | inst, |
| 1183 | format!( |
| 1184 | "The instruction expects {constant} to have a size of {type_size} bytes but it has {constant_size}" |
| 1185 | ), |
| 1186 | )) |
| 1187 | } else { |
| 1188 | Ok(()) |
| 1189 | } |
| 1190 | } |
| 1191 | |
| 1192 | fn verify_is_address( |
| 1193 | &self, |
no test coverage detected