add runtime safety for noreturn function returning

Closes #15221
This commit is contained in:
Veikka Tuominen
2023-04-10 18:48:23 +03:00
parent 2286c19c20
commit b91d6ff9e8
4 changed files with 55 additions and 4 deletions

View File

@@ -5030,7 +5030,6 @@ pub const FuncGen = struct {
}
if (return_type.isNoReturn() and attr != .AlwaysTail) {
_ = self.builder.buildUnreachable();
return null;
}