diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2025-07-09 23:55:57 +0200 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2025-07-09 23:55:57 +0200 |
| commit | e735e036b4df84db84aa7d66c1118b3e906f0022 (patch) | |
| tree | a1d9e8a004600abd57dd582651cdf9f0b82443ee /src/check_stmt.cpp | |
| parent | 090cac62f9cc30f759cba086298b4bdb8c7c62b3 (diff) | |
Fix #5447
Thanks to @FourteenBrush
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 07801b477..7187d95b3 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -2778,6 +2778,10 @@ gb_internal void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) Ast *stmt = ds->stmt; Ast *original_stmt = stmt; + if (stmt->kind == Ast_BlockStmt && stmt->BlockStmt.stmts.count == 0) { + break; // empty defer statement + } + bool is_singular = true; while (is_singular && stmt->kind == Ast_BlockStmt) { Ast *inner_stmt = nullptr; |