From 85c05b238e5d6f454754e70edae24872b0c573cc Mon Sep 17 00:00:00 2001 From: gingerBill Date: Tue, 17 Mar 2026 13:50:49 +0000 Subject: [PATCH] Handle bit fields separately --- src/check_expr.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 9c9f99fc0..9044d8346 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -2235,7 +2235,7 @@ gb_internal bool check_representable_as_constant(CheckerContext *c, ExactValue i case Basic_i16be: case Basic_i32be: case Basic_i64be: - { + if (c->bit_field_bit_size == 0) { // return imin <= i && i <= imax; if (!big_int_can_be_represented_in_64_bits(&i)) { return false; @@ -2245,7 +2245,7 @@ gb_internal bool check_representable_as_constant(CheckerContext *c, ExactValue i return imin_64 <= val64 && val64 <= imax_64; } - + /*fallthrough*/ case Basic_i128le: case Basic_i128: case Basic_i128be: @@ -2269,7 +2269,7 @@ gb_internal bool check_representable_as_constant(CheckerContext *c, ExactValue i case Basic_u16be: case Basic_u32be: case Basic_u64be: - { + if (c->bit_field_bit_size == 0) { if (big_int_is_neg(&i)) { return false; } @@ -2281,7 +2281,7 @@ gb_internal bool check_representable_as_constant(CheckerContext *c, ExactValue i return val64 <= umax_64; } - + /*fallthrough*/ case Basic_u128: case Basic_u128le: case Basic_u128be: