aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-07-22 16:29:35 +0100
committergingerBill <bill@gingerbill.org>2024-07-22 16:29:35 +0100
commit915c5c3a870007687686e8e05fed59cdeb56be56 (patch)
tree79500cc3342f3667b53cd2e5d22adfa1fceb5c51 /src/check_stmt.cpp
parentfcaa47986aa5477e60a67a4ace5c7b020b214afd (diff)
parent07d2aba31037c645327f28eba179d6cdba245cca (diff)
Merge branch 'master' of https://github.com/odin-lang/Odin
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp2
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");