(&self, function_handle: &FunctionHandle)
| 197 | } |
| 198 | |
| 199 | fn check_function_handle(&self, function_handle: &FunctionHandle) -> PartialVMResult<()> { |
| 200 | check_bounds_impl(self.view.module_handles(), function_handle.module)?; |
| 201 | check_bounds_impl(self.view.identifiers(), function_handle.name)?; |
| 202 | check_bounds_impl(self.view.signatures(), function_handle.parameters)?; |
| 203 | check_bounds_impl(self.view.signatures(), function_handle.return_)?; |
| 204 | // function signature type paramters must be in bounds to the function type parameters |
| 205 | let type_param_count = function_handle.type_parameters.len(); |
| 206 | if let Some(sig) = self |
| 207 | .view |
| 208 | .signatures() |
| 209 | .get(function_handle.parameters.into_index()) |
| 210 | { |
| 211 | for ty in &sig.0 { |
| 212 | self.check_type_parameter(ty, type_param_count)? |
| 213 | } |
| 214 | } |
| 215 | if let Some(sig) = self |
| 216 | .view |
| 217 | .signatures() |
| 218 | .get(function_handle.return_.into_index()) |
| 219 | { |
| 220 | for ty in &sig.0 { |
| 221 | self.check_type_parameter(ty, type_param_count)? |
| 222 | } |
| 223 | } |
| 224 | Ok(()) |
| 225 | } |
| 226 | |
| 227 | fn check_field_handle(&self, field_handle: &FieldHandle) -> PartialVMResult<()> { |
| 228 | check_bounds_impl_opt(&self.view.struct_defs(), field_handle.owner)?; |
no test coverage detected