aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/stage1/ir.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/stage1/ir.cpp b/src/stage1/ir.cpp
index 62d466fa88..98422ef578 100644
--- a/src/stage1/ir.cpp
+++ b/src/stage1/ir.cpp
@@ -21592,6 +21592,11 @@ static IrInstGen *ir_analyze_instruction_cond_br(IrAnalyze *ira, IrInstSrcCondBr
static IrInstGen *ir_analyze_instruction_unreachable(IrAnalyze *ira,
IrInstSrcUnreachable *unreachable_instruction)
{
+ if (ir_should_inline(ira->old_irb.exec, unreachable_instruction->base.base.scope)) {
+ ir_add_error(ira, &unreachable_instruction->base.base, buf_sprintf("reached unreachable code"));
+ return ir_unreach_error(ira);
+ }
+
IrInstGen *result = ir_build_unreachable_gen(ira, &unreachable_instruction->base.base);
return ir_finish_anal(ira, result);
}