Builds the `FunctionHandle` table.
(
binary: &VersionedBinary,
table: &Table,
function_handles: &mut Vec<FunctionHandle>,
)
| 675 | |
| 676 | /// Builds the `FunctionHandle` table. |
| 677 | fn load_function_handles( |
| 678 | binary: &VersionedBinary, |
| 679 | table: &Table, |
| 680 | function_handles: &mut Vec<FunctionHandle>, |
| 681 | ) -> BinaryLoaderResult<()> { |
| 682 | let start = table.offset as usize; |
| 683 | let end = start + table.count as usize; |
| 684 | let mut cursor = binary.new_cursor(start, end); |
| 685 | while cursor.position() < table.count as u64 { |
| 686 | let module = load_module_handle_index(&mut cursor)?; |
| 687 | let name = load_identifier_index(&mut cursor)?; |
| 688 | let parameters = load_signature_index(&mut cursor)?; |
| 689 | let return_ = load_signature_index(&mut cursor)?; |
| 690 | let type_parameters = |
| 691 | load_ability_sets(&mut cursor, AbilitySetPosition::FunctionTypeParameters)?; |
| 692 | |
| 693 | function_handles.push(FunctionHandle { |
| 694 | module, |
| 695 | name, |
| 696 | parameters, |
| 697 | return_, |
| 698 | type_parameters, |
| 699 | }); |
| 700 | } |
| 701 | Ok(()) |
| 702 | } |
| 703 | |
| 704 | /// Builds the `StructInstantiation` table. |
| 705 | fn load_struct_instantiations( |
no test coverage detected