mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
gen-wasm: Do not repoint stack memory to locals upon copy
It is possible that other code paths will use the stack memory before a copy to a local is done. For example, if the copy happens behind a branch, the local variable may not be assigned the stack content.
This commit is contained in:
parent
15ef517cf2
commit
fb4282757a
1 changed files with 5 additions and 1 deletions
|
@ -721,7 +721,11 @@ impl<'a> Storage<'a> {
|
|||
debug_assert!(to_size == from_size);
|
||||
self.load_symbols(code_builder, &[from_symbol]);
|
||||
code_builder.set_local(*to_local_id);
|
||||
self.symbol_storage_map.insert(from_symbol, to.clone());
|
||||
|
||||
// Do not repoint the stack memory to the local variable, because it is
|
||||
// possible that other code paths will use the stack memory before this copy.
|
||||
// For example, if the copy happens behind a branch, the local variable may not be
|
||||
// assigned the stack content.
|
||||
}
|
||||
|
||||
(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue