gingerBill 11 months ago
parent
commit
aa659a637a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/check_stmt.cpp

+ 2 - 1
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));
 			Type *t = base_type(type_deref(operand.type));
 
 
 			switch (t->kind) {
 			switch (t->kind) {
@@ -1738,6 +1738,7 @@ gb_internal void check_range_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags)
 				break;
 				break;
 
 
 			case Type_EnumeratedArray:
 			case Type_EnumeratedArray:
+				is_possibly_addressable = operand.mode == Addressing_Variable || is_ptr;
 				array_add(&vals, t->EnumeratedArray.elem);
 				array_add(&vals, t->EnumeratedArray.elem);
 				array_add(&vals, t->EnumeratedArray.index);
 				array_add(&vals, t->EnumeratedArray.index);
 				break;
 				break;