From d3f3fe98e3edfc7f20f32db9f23851d4f715bdc9 Mon Sep 17 00:00:00 2001 From: Jakub Doka Date: Tue, 17 Dec 2024 19:08:53 +0100 Subject: [PATCH] propagating unreachable for functions returning never type Signed-off-by: Jakub Doka --- lang/src/son.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lang/src/son.rs b/lang/src/son.rs index 3d6b438..f467050 100644 --- a/lang/src/son.rs +++ b/lang/src/son.rs @@ -2660,6 +2660,10 @@ impl<'a> Codegen<'a> { self.add_clobber_stores(clobbered_aliases); + if sig.ret == ty::Id::NEVER { + return None; + } + alt_value.or(Some(Value::new(self.ci.ctrl.get()).ty(sig.ret))) } }