mirror of
https://github.com/fluencelabs/wasm-utils
synced 2025-05-29 15:41:20 +00:00
Merge branch 'preserve-start' into unknown-lift
This commit is contained in:
commit
c7e2ec5c60
@ -190,6 +190,10 @@ pub fn optimize(
|
|||||||
|
|
||||||
for section in module.sections_mut() {
|
for section in module.sections_mut() {
|
||||||
match section {
|
match section {
|
||||||
|
&mut elements::Section::Start(ref mut func_index) if eliminated_funcs.len() > 0 => {
|
||||||
|
let totalle = eliminated_funcs.iter().take_while(|i| (**i as u32) < *func_index).count();
|
||||||
|
*func_index -= totalle as u32;
|
||||||
|
},
|
||||||
&mut elements::Section::Function(ref mut function_section) if eliminated_types.len() > 0 => {
|
&mut elements::Section::Function(ref mut function_section) if eliminated_types.len() > 0 => {
|
||||||
for ref mut func_signature in function_section.entries_mut() {
|
for ref mut func_signature in function_section.entries_mut() {
|
||||||
let totalle = eliminated_types.iter().take_while(|i| (**i as u32) < func_signature.type_ref()).count();
|
let totalle = eliminated_types.iter().take_while(|i| (**i as u32) < func_signature.type_ref()).count();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user