aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-12-05 15:46:35 +0000
committergingerBill <bill@gingerbill.org>2024-12-05 15:46:35 +0000
commite3b16464908f2d6e85b7569ad4da6a802e3283c3 (patch)
treee8fb1e60133ca1a343b55c3394f4d1aaff6a2662 /src/check_stmt.cpp
parentdd8e6e884c181b6d6775eedcfc3bad1365405f4f (diff)
Fix #4552
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 e2d6f68fa..02ad72388 100644
--- a/src/check_stmt.cpp
+++ b/src/check_stmt.cpp
@@ -2605,6 +2605,7 @@ gb_internal void check_for_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags) {
if (cond && cond->kind == Ast_BinaryExpr &&
cond->BinaryExpr.left && cond->BinaryExpr.right &&
cond->BinaryExpr.op.kind == Token_GtEq &&
+ type_of_expr(cond->BinaryExpr.left) != nullptr &&
is_type_unsigned(type_of_expr(cond->BinaryExpr.left)) &&
cond->BinaryExpr.right->tav.value.kind == ExactValue_Integer &&
is_exact_value_zero(cond->BinaryExpr.right->tav.value)) {