load literal symbols when inserting a jump

This commit is contained in:
Folkert 2023-04-08 13:15:22 +02:00
parent aa54033dd2
commit a7aa9530b6
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
3 changed files with 5 additions and 4 deletions

View file

@ -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;

View file

@ -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());

View file

@ -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!(