aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-12-05 15:27:41 +0000
committergingerBill <bill@gingerbill.org>2024-12-05 15:27:41 +0000
commitf5b16aa42aae8dd53f6138cc8593f7937733dc90 (patch)
tree6dbdc765f93d682795c6d7e21522a5bab4db033d /src/check_stmt.cpp
parentf7761ebcc4dd22ae98335c3845e07e496c010ee4 (diff)
Fix #4561
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp
index 2418fcc5c..e2d6f68fa 100644
--- a/src/check_stmt.cpp
+++ b/src/check_stmt.cpp
@@ -2612,6 +2612,7 @@ gb_internal void check_for_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags) {
} else if (cond && cond->kind == Ast_BinaryExpr &&
cond->BinaryExpr.left && cond->BinaryExpr.right &&
cond->BinaryExpr.op.kind == Token_LtEq &&
+ type_of_expr(cond->BinaryExpr.right) != nullptr &&
is_type_unsigned(type_of_expr(cond->BinaryExpr.right)) &&
cond->BinaryExpr.left->tav.value.kind == ExactValue_Integer &&
is_exact_value_zero(cond->BinaryExpr.left->tav.value)) {