aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-08-24 15:46:54 +0100
committergingerBill <bill@gingerbill.org>2024-08-24 15:46:54 +0100
commitaa659a637a70af21feb60ee08c11c46718defa30 (patch)
tree0fd9001abc23819025c943b2fc8d82e7ae6ca4a4 /src/check_stmt.cpp
parent0e71e93b220fbcf3daa8e430a0b2b7717f0b807f (diff)
Fix #4132
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp
index 1ef51e585..c8717ba98 100644
--- a/src/check_stmt.cpp
+++ b/src/check_stmt.cpp
@@ -1698,7 +1698,7 @@ gb_internal void check_range_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags)
}
}
}
- bool is_ptr = type_deref(operand.type);
+ bool is_ptr = is_type_pointer(type_deref(operand.type));
Type *t = base_type(type_deref(operand.type));
switch (t->kind) {
@@ -1738,6 +1738,7 @@ gb_internal void check_range_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags)
break;
case Type_EnumeratedArray:
+ is_possibly_addressable = operand.mode == Addressing_Variable || is_ptr;
array_add(&vals, t->EnumeratedArray.elem);
array_add(&vals, t->EnumeratedArray.index);
break;