diff options
| author | gingerBill <bill@gingerbill.org> | 2024-03-16 22:12:17 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-03-16 22:12:17 +0000 |
| commit | 3875fb08e839d45d2c855115008857b3134f8337 (patch) | |
| tree | 42fc7198a9deaf4de2cbfe7a4ff2525a13337e7b /src/check_expr.cpp | |
| parent | 04f0fbf23a22dde3b750e27d844df84273dafa87 (diff) | |
Fix #3284
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 1e4c7499b..3f46e2bdd 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -8405,6 +8405,7 @@ gb_internal ExprKind check_or_branch_expr(CheckerContext *c, Operand *o, Ast *no switch (be->token.kind) { case Token_or_break: + node->viral_state_flags |= ViralStateFlag_ContainsOrBreak; if ((c->stmt_flags & Stmt_BreakAllowed) == 0 && label == nullptr) { error(be->token, "'%.*s' only allowed in non-inline loops or 'switch' statements", LIT(name)); } @@ -10254,6 +10255,7 @@ gb_internal ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast case_end; case_ast_node(re, OrReturnExpr, node); + node->viral_state_flags |= ViralStateFlag_ContainsOrReturn; return check_or_return_expr(c, o, node, type_hint); case_end; |