mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
Fix dummy function replacement
This commit is contained in:
parent
ba99870de0
commit
0c81063c68
1 changed files with 2 additions and 2 deletions
|
@ -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.
|
||||
//
|
||||
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;
|
||||
buffer.extend_from_slice(&self.code.bytes[code_start..code_end]);
|
||||
} else {
|
||||
buffer.extend_from_slice(&DUMMY_FUNCTION);
|
||||
DUMMY_FUNCTION.serialize(&mut buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue