From f5b16aa42aae8dd53f6138cc8593f7937733dc90 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 5 Dec 2024 15:27:41 +0000 Subject: Fix #4561 --- src/check_stmt.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/check_stmt.cpp') 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)) { -- cgit v1.2.3