diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2022-08-11 16:14:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-11 16:14:27 +0100 |
| commit | 57b20e634bf7bd9c606ceb3aec425beb4a1d0db8 (patch) | |
| tree | 8633580c3cc47b360de210dd5faf35b4e9d6a011 /src/check_stmt.cpp | |
| parent | 425dec8bb8cc4fe2cf25a008de199d3084ecb510 (diff) | |
| parent | e285796fc11148c2f461a1d3753d28babd83769e (diff) | |
Merge branch 'master' into pretty-json-2
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index a6f6f1a7d..451325324 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -1,8 +1,5 @@ -bool is_diverging_stmt(Ast *stmt) { - if (stmt->kind != Ast_ExprStmt) { - return false; - } - Ast *expr = unparen_expr(stmt->ExprStmt.expr); +bool is_diverging_expr(Ast *expr) { + expr = unparen_expr(expr); if (expr->kind != Ast_CallExpr) { return false; } @@ -26,6 +23,12 @@ bool is_diverging_stmt(Ast *stmt) { t = base_type(t); return t != nullptr && t->kind == Type_Proc && t->Proc.diverging; } +bool is_diverging_stmt(Ast *stmt) { + if (stmt->kind != Ast_ExprStmt) { + return false; + } + return is_diverging_expr(stmt->ExprStmt.expr); +} bool contains_deferred_call(Ast *node) { if (node->viral_state_flags & ViralStateFlag_ContainsDeferredProcedure) { |