Browse Source

Fix `bit_set` construction crash on constant non-integer field

Feoramund 1 year ago
parent
commit
78a5a27212
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/check_expr.cpp

+ 3 - 1
src/check_expr.cpp

@@ -9819,7 +9819,9 @@ gb_internal ExprKind check_compound_literal(CheckerContext *c, Operand *o, Ast *
 				if (tav.mode != Addressing_Constant) {
 				if (tav.mode != Addressing_Constant) {
 					continue;
 					continue;
 				}
 				}
-				GB_ASSERT(tav.value.kind == ExactValue_Integer);
+				if (tav.value.kind != ExactValue_Integer) {
+					continue;
+				}
 				i64 v = big_int_to_i64(&tav.value.value_integer);
 				i64 v = big_int_to_i64(&tav.value.value_integer);
 				i64 lower = bt->BitSet.lower;
 				i64 lower = bt->BitSet.lower;
 				u64 index = cast(u64)(v-lower);
 				u64 index = cast(u64)(v-lower);