From 59a0bbb38512054eb5c6fc83383c3638ed03d1bf Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 6 Jun 2020 15:16:24 +0100 Subject: Improve termination rules checking for missing `return`; Make diverging procedure `-> !` be terminators --- src/ir.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index 381c24459..04623f65f 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -3173,6 +3173,10 @@ irValue *ir_emit_call(irProcedure *p, irValue *value, Array const &ar } } + defer (if (pt->Proc.diverging) { + ir_emit_unreachable(p); + }); + irValue *context_ptr = nullptr; if (pt->Proc.calling_convention == ProcCC_Odin) { context_ptr = ir_find_or_generate_context_ptr(p); -- cgit v1.2.3