mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-21 07:49:17 +03:00
Fix dummy function replacement
This commit is contained in:
parent
ba99870de0
commit
0c81063c68
@ -283,7 +283,7 @@ impl<'a> WasmModule<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Dead code elimination. Replace dead functions with tiny dummies.
|
// Code section: Replace dead functions with tiny dummies.
|
||||||
// Live function indices are unchanged, so no relocations are needed.
|
// Live function indices are unchanged, so no relocations are needed.
|
||||||
//
|
//
|
||||||
let mut buffer = Vec::with_capacity_in(self.code.bytes.len(), arena);
|
let mut buffer = Vec::with_capacity_in(self.code.bytes.len(), arena);
|
||||||
@ -294,7 +294,7 @@ impl<'a> WasmModule<'a> {
|
|||||||
let code_end = self.code.function_offsets[i + 1] as usize;
|
let code_end = self.code.function_offsets[i + 1] as usize;
|
||||||
buffer.extend_from_slice(&self.code.bytes[code_start..code_end]);
|
buffer.extend_from_slice(&self.code.bytes[code_start..code_end]);
|
||||||
} else {
|
} else {
|
||||||
buffer.extend_from_slice(&DUMMY_FUNCTION);
|
DUMMY_FUNCTION.serialize(&mut buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user