mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
Wasm: refactor the model of the Linking section
This commit is contained in:
parent
8cf82ae1b3
commit
738434329e
6 changed files with 64 additions and 71 deletions
|
@ -728,13 +728,11 @@ impl<'a> WasmModule<'a> {
|
|||
code_section_body_index: usize,
|
||||
n_imported_fns: u32,
|
||||
) {
|
||||
let symbol_table = self.linking.symbol_table_mut();
|
||||
|
||||
// Lookup vector of symbol index to new function index
|
||||
let mut new_index_lookup = std::vec::Vec::with_capacity(symbol_table.len());
|
||||
let mut new_index_lookup = std::vec::Vec::with_capacity(self.linking.symbol_table.len());
|
||||
|
||||
// Modify symbol table entries and fill the lookup vector
|
||||
for sym_info in symbol_table.iter_mut() {
|
||||
for sym_info in self.linking.symbol_table.iter_mut() {
|
||||
match sym_info {
|
||||
SymInfo::Function(WasmObjectSymbol::Defined { index, .. }) => {
|
||||
let new_fn_index = *index + n_imported_fns;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue