mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-23 06:05:00 -07:00
Fix #911 for -llvm-api backend
This commit is contained in:
@@ -3282,7 +3282,7 @@ void lb_end_procedure_body(lbProcedure *p) {
|
||||
// Make sure every block terminates, and if not, make it unreachable
|
||||
for (block = first_block; block != nullptr; block = LLVMGetNextBasicBlock(block)) {
|
||||
LLVMValueRef instr = LLVMGetLastInstruction(block);
|
||||
if (instr == nullptr) {
|
||||
if (instr == nullptr || !lb_is_instr_terminating(instr)) {
|
||||
LLVMPositionBuilderAtEnd(p->builder, block);
|
||||
LLVMBuildUnreachable(p->builder);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user