mirror of
https://github.com/fluencelabs/wasm-utils
synced 2025-05-31 08:31:21 +00:00
fix also bug with externalizer
This commit is contained in:
parent
b2d04ea3a9
commit
de3b30dab5
@ -89,6 +89,14 @@ pub fn externalize(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
&mut elements::Section::Element(ref mut elements_section) => {
|
||||||
|
for ref mut segment in elements_section.entries_mut() {
|
||||||
|
// update all indirect call addresses initial values
|
||||||
|
for func_index in segment.members_mut() {
|
||||||
|
if *func_index >= import_funcs_total as u32 { *func_index += replaces.len() as u32; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
_ => { }
|
_ => { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -256,11 +256,11 @@ pub struct Set {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Set {
|
impl Set {
|
||||||
fn new(entries: HashMap<InstructionType, u32>) -> Self {
|
pub fn new(entries: HashMap<InstructionType, u32>) -> Self {
|
||||||
Set { entries: entries }
|
Set { entries: entries }
|
||||||
}
|
}
|
||||||
|
|
||||||
fn process(&self, opcode: &elements::Opcode) -> u32 {
|
pub fn process(&self, opcode: &elements::Opcode) -> u32 {
|
||||||
self.entries.get(&InstructionType::op(opcode)).map(|x| *x).unwrap_or(1)
|
self.entries.get(&InstructionType::op(opcode)).map(|x| *x).unwrap_or(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user