mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 06:55:15 +00:00
load literal symbols when inserting a jump
This commit is contained in:
parent
aa54033dd2
commit
a7aa9530b6
3 changed files with 5 additions and 4 deletions
|
@ -1166,9 +1166,9 @@ impl<
|
|||
Some(storages) => storages,
|
||||
None => internal_error!("Jump: unknown point specified to jump to: {:?}", id),
|
||||
};
|
||||
for ((sym, layout), wanted_storage) in
|
||||
args.iter().zip(arg_layouts).zip(param_storage.iter())
|
||||
{
|
||||
|
||||
let it = args.iter().zip(arg_layouts).zip(param_storage.iter());
|
||||
for ((sym, layout), wanted_storage) in it {
|
||||
// Note: it is possible that the storage we want to move to is in use by one of the args we want to pass.
|
||||
if self.get_storage_for_sym(sym) == wanted_storage {
|
||||
continue;
|
||||
|
|
|
@ -213,6 +213,7 @@ trait Backend<'a> {
|
|||
self.free_symbols(stmt);
|
||||
}
|
||||
Stmt::Jump(id, args) => {
|
||||
self.load_literal_symbols(args);
|
||||
let mut arg_layouts: bumpalo::collections::Vec<InLayout<'a>> =
|
||||
bumpalo::vec![in self.env().arena];
|
||||
arg_layouts.reserve(args.len());
|
||||
|
|
|
@ -825,7 +825,7 @@ fn join_point_if() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||
fn join_point_when() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue