mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Fix import relocations in CodeBuilder.
This commit is contained in:
parent
4dea82b2f5
commit
ddddb7d4f1
3 changed files with 60 additions and 52 deletions
|
@ -363,12 +363,8 @@ impl<'a> WasmBackend<'a> {
|
|||
|
||||
/// Reset function-level data
|
||||
fn reset(&mut self) {
|
||||
// Push the completed CodeBuilder into the module and swap it for a new empty one
|
||||
let mut swap_code_builder = CodeBuilder::new(self.env.arena);
|
||||
std::mem::swap(&mut swap_code_builder, &mut self.code_builder);
|
||||
|
||||
swap_code_builder.serialize_without_relocs(&mut self.module.code.bytes);
|
||||
|
||||
self.code_builder.insert_into_module(&mut self.module);
|
||||
self.code_builder.clear();
|
||||
self.storage.clear();
|
||||
self.joinpoint_label_map.clear();
|
||||
assert_eq!(self.block_depth, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue