mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-28 16:11:32 +00:00
Fix bug in LLVM lowering of 'return' when the stack has a float on it.
This commit is contained in:
@ -1412,14 +1412,11 @@ impl FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Operator::Return => {
|
Operator::Return => {
|
||||||
let frame = state.outermost_frame()?;
|
|
||||||
let current_block = builder.get_insert_block().ok_or(BinaryReaderError {
|
let current_block = builder.get_insert_block().ok_or(BinaryReaderError {
|
||||||
message: "not currently in a block",
|
message: "not currently in a block",
|
||||||
offset: -1isize as usize,
|
offset: -1isize as usize,
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
builder.build_unconditional_branch(frame.br_dest());
|
|
||||||
|
|
||||||
let frame = state.outermost_frame()?;
|
let frame = state.outermost_frame()?;
|
||||||
for phi in frame.phis().to_vec().iter() {
|
for phi in frame.phis().to_vec().iter() {
|
||||||
let (arg, info) = state.pop1_extra()?;
|
let (arg, info) = state.pop1_extra()?;
|
||||||
@ -1427,6 +1424,9 @@ impl FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator {
|
|||||||
phi.add_incoming(&[(&arg, ¤t_block)]);
|
phi.add_incoming(&[(&arg, ¤t_block)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let frame = state.outermost_frame()?;
|
||||||
|
builder.build_unconditional_branch(frame.br_dest());
|
||||||
|
|
||||||
state.reachable = false;
|
state.reachable = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user