Merge pull request #3772 from Feoramund/fix-constant-wrong-type-bitset

Fix `bit_set` construction crash on constant non-integer field
This commit is contained in:
Jeroen van Rijn
2024-06-16 19:15:50 +02:00
committed by GitHub

View File

@@ -9819,7 +9819,9 @@ gb_internal ExprKind check_compound_literal(CheckerContext *c, Operand *o, Ast *
if (tav.mode != Addressing_Constant) {
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 lower = bt->BitSet.lower;
u64 index = cast(u64)(v-lower);