mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00: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
|
// Make sure every block terminates, and if not, make it unreachable
|
||||||
for (block = first_block; block != nullptr; block = LLVMGetNextBasicBlock(block)) {
|
for (block = first_block; block != nullptr; block = LLVMGetNextBasicBlock(block)) {
|
||||||
LLVMValueRef instr = LLVMGetLastInstruction(block);
|
LLVMValueRef instr = LLVMGetLastInstruction(block);
|
||||||
if (instr == nullptr) {
|
if (instr == nullptr || !lb_is_instr_terminating(instr)) {
|
||||||
LLVMPositionBuilderAtEnd(p->builder, block);
|
LLVMPositionBuilderAtEnd(p->builder, block);
|
||||||
LLVMBuildUnreachable(p->builder);
|
LLVMBuildUnreachable(p->builder);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user