aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-01-03 13:48:12 +0000
committergingerBill <bill@gingerbill.org>2022-01-03 13:48:12 +0000
commitdefc1672c3d1b27c4720f53e95a0e1be0775e5e9 (patch)
tree22fce0f59ab10e4be6a1847b4191e7da4b41255b /src/check_stmt.cpp
parent12f459b5fb7904bfa926b5ad3fc5f80c6b5b4193 (diff)
Revert fix #1344
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp
index c3b8c46ca..396388629 100644
--- a/src/check_stmt.cpp
+++ b/src/check_stmt.cpp
@@ -58,30 +58,6 @@ bool contains_deferred_call(Ast *node) {
return false;
}
-Ast *last_stmt_blocking_in_list(Slice<Ast *> const &stmts) {
- for_array(i, stmts) {
- Ast *n = stmts[i];
- switch (n->kind) {
- case Ast_ReturnStmt:
- return n;
- case Ast_BranchStmt:
- return n;
- case Ast_ExprStmt:
- if (is_diverging_stmt(n)) {
- return n;
- }
- break;
- case Ast_BlockStmt:
- n = last_stmt_blocking_in_list(n->BlockStmt.stmts);
- if (n != nullptr) {
- return n;
- }
- break;
- }
- }
- return nullptr;
-}
-
void check_stmt_list(CheckerContext *ctx, Slice<Ast *> const &stmts, u32 flags) {
if (stmts.count == 0) {
return;
@@ -126,7 +102,6 @@ void check_stmt_list(CheckerContext *ctx, Slice<Ast *> const &stmts, u32 flags)
check_stmt(ctx, n, new_flags);
if (i+1 < max_non_constant_declaration) {
- never_executed_error:;
switch (n->kind) {
case Ast_ReturnStmt:
error(n, "Statements after this 'return' are never executed");
@@ -141,13 +116,6 @@ void check_stmt_list(CheckerContext *ctx, Slice<Ast *> const &stmts, u32 flags)
error(n, "Statements after a diverging procedure call are never executed");
}
break;
-
- case Ast_BlockStmt:
- n = last_stmt_blocking_in_list(n->BlockStmt.stmts);
- if (n != nullptr) {
- goto never_executed_error;
- }
- break;
}
} else if (i+1 == max_non_constant_declaration) {
if (is_diverging_stmt(n)) {