Fix value stack after return instruction in multi-value function.

This commit is contained in:
Nick Lewycky
2020-06-01 20:05:43 -07:00
parent 95c55ab40d
commit 46159ee2a6

View File

@ -1890,7 +1890,7 @@ impl<'ctx, 'a> LLVMFunctionCodeGenerator<'ctx, 'a> {
.ok_or_else(|| CompileError::Codegen("not currently in a block".to_string()))?;
let frame = self.state.outermost_frame()?;
for phi in frame.phis().to_vec().iter() {
for phi in frame.phis().to_vec().iter().rev() {
let (arg, info) = self.state.pop1_extra()?;
let arg = self.apply_pending_canonicalization(arg, info);
phi.add_incoming(&[(&arg, current_block)]);