aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-06-07 12:18:21 +0100
committergingerBill <bill@gingerbill.org>2023-06-07 12:18:21 +0100
commit9941ec85d8530b8105029e5517eeca0798c2509a (patch)
tree9556a3c63c49819b11ab9c5cf19ab8c59beefd7b /src/check_stmt.cpp
parentef944b903b25e4ddc30af1ff14beee9e349d3a5f (diff)
Fix #2578 (check for `fallthrough`)
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp
index bdfa24460..09af496ab 100644
--- a/src/check_stmt.cpp
+++ b/src/check_stmt.cpp
@@ -239,6 +239,10 @@ gb_internal bool check_is_terminating(Ast *node, String const &label) {
return check_is_terminating(unparen_expr(es->expr), label);
case_end;
+ case_ast_node(bs, BranchStmt, node);
+ return bs->token.kind == Token_fallthrough;
+ case_end;
+
case_ast_node(is, IfStmt, node);
if (is->else_stmt != nullptr) {
if (check_is_terminating(is->body, label) &&