diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2024-07-21 02:52:53 +0200 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2024-07-21 02:52:53 +0200 |
| commit | 431227d4c50e5b53e5c4c922a76c11ec8464baa3 (patch) | |
| tree | 7dc0a1a32a6b68a3d4bb4bb99fccdbc361d6bd99 /src/check_stmt.cpp | |
| parent | fc5ce30f34163ce1dfa7ad8b01e60317c8d43c01 (diff) | |
Add NULL check in check_range_stmt
Fixes #3953
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 74397828d..6c3570cc8 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -1837,7 +1837,7 @@ gb_internal void check_range_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags) if (rs->vals.count == 1) { Type *t = type_deref(operand.type); - if (is_type_map(t) || is_type_bit_set(t)) { + if (t != NULL && (is_type_map(t) || is_type_bit_set(t))) { gbString v = expr_to_string(rs->vals[0]); defer (gb_string_free(v)); error_line("\tSuggestion: place parentheses around the expression\n"); |