Implement fix

This commit is contained in:
Pranav Gaddamadugu 2023-10-18 09:55:24 -04:00
parent 662cc7da31
commit e34caf1458
2 changed files with 7 additions and 2 deletions

View File

@ -551,7 +551,12 @@ impl<'a> CodeGenerator<'a> {
Some(Expression::Identifier(identifier)) => identifier,
_ => unreachable!("If `has_finalize` is true, then the external call must be an identifier."),
};
self.futures.push((future_register, format!("{program_id}/{function_name}")));
// Add the futures register to the list of futures.
self.futures.push((future_register.clone(), format!("{program_id}/{function_name}")));
// Add the future register to the list of destinations.
destinations.push(future_register);
}
// If destination registers were created, write them to the call instruction.

View File

@ -167,7 +167,7 @@ impl<'a> CodeGenerator<'a> {
}
// Write the destination register.
let destination_register = format!("r{}", self.next_register);
write!(async_instruction, " into {};", destination_register).expect("failed to write to string");
write!(async_instruction, " into {};\n", destination_register).expect("failed to write to string");
// Increment the register counter.
self.next_register += 1;
// Add the async instruction to the instructions.