diff options
| author | gingerBill <bill@gingerbill.org> | 2024-03-16 22:24:34 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-03-16 22:24:34 +0000 |
| commit | 19eb2a8890e41d088d96e4608737bbede5508f59 (patch) | |
| tree | d92e5f524724bb24ea9e20dce9cbf71373f0abe7 /src | |
| parent | 3875fb08e839d45d2c855115008857b3134f8337 (diff) | |
Fix #3282
Diffstat (limited to 'src')
| -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 1aa473fd6..d31af08da 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -1543,8 +1543,12 @@ gb_internal void check_range_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags) goto skip_expr_range_stmt; } } else if (operand.mode != Addressing_Invalid) { + if (operand.mode == Addressing_OptionalOk || operand.mode == Addressing_OptionalOkPtr) { + check_promote_optional_ok(ctx, &operand, nullptr, nullptr); + } bool is_ptr = is_type_pointer(operand.type); Type *t = base_type(type_deref(operand.type)); + switch (t->kind) { case Type_Basic: if (t->Basic.kind == Basic_string || t->Basic.kind == Basic_UntypedString) { |