fix(compiler) Fix BrTable on llvm compiler when non default is jumpting on loop_body

This commit is contained in:
ptitSeb
2021-11-09 11:44:47 +01:00
parent 34e0574886
commit 2b7669d346

View File

@ -1621,8 +1621,12 @@ impl<'ctx, 'a> LLVMFunctionCodeGenerator<'ctx, 'a> {
};
let case_index_literal =
self.context.i32_type().const_int(case_index as u64, false);
for (phi, value) in frame.phis().iter().zip(args.iter()) {
let phis = if frame.is_loop() {
frame.loop_body_phis()
} else {
frame.phis()
};
for (phi, value) in phis.iter().zip(args.iter()) {
phi.add_incoming(&[(value, current_block)]);
}