(
&mut self,
function: wasmparser::FunctionBody<'_>,
validator: &mut Validator,
options: &ParserOptions,
)
| 211 | } |
| 212 | |
| 213 | pub(crate) fn process_inline_code_section_entry( |
| 214 | &mut self, |
| 215 | function: wasmparser::FunctionBody<'_>, |
| 216 | validator: &mut Validator, |
| 217 | options: &ParserOptions, |
| 218 | ) -> Result<()> { |
| 219 | debug!("Found code section entry"); |
| 220 | |
| 221 | let func_validator_allocs = self.func_validator_allocations.take().unwrap_or_default(); |
| 222 | let operators_reader_allocs = self.operators_reader_allocations.take().unwrap_or_default(); |
| 223 | |
| 224 | let func_to_validate = validator.code_section_entry(&function)?; |
| 225 | let func_validator = func_to_validate.into_validator(func_validator_allocs); |
| 226 | |
| 227 | let (code, func_validator_allocs, operators_reader_allocs) = |
| 228 | convert_module_code(function, func_validator, operators_reader_allocs)?; |
| 229 | |
| 230 | self.code.push(optimize_function_code( |
| 231 | code, |
| 232 | options, |
| 233 | self.function_results(self.code.len()), |
| 234 | (imported_func_count(&self.imports) + self.code.len()) as u32, |
| 235 | imported_memory_count(&self.imports), |
| 236 | )); |
| 237 | |
| 238 | self.func_validator_allocations = Some(func_validator_allocs); |
| 239 | self.operators_reader_allocations = Some(operators_reader_allocs); |
| 240 | Ok(()) |
| 241 | } |
| 242 | |
| 243 | pub(crate) fn process_borrowed_code_section_entry( |
| 244 | &mut self, |
no test coverage detected