Fixed ~ on bit_set[Some_Enum] altering the definition of the enum.

This was occurring for enums whose minimum values were greater than
zero.
This commit is contained in:
Barinzaya
2025-03-02 13:29:39 -05:00
parent 94152ca701
commit 6e3d17d189

View File

@@ -2599,9 +2599,8 @@ gb_internal ExactValue exact_bit_set_all_set_mask(Type *type) {
continue;
}
BigInt shift_amount = f->Constant.value.value_integer;
big_int_sub_eq(&shift_amount, &b_lower_base);
BigInt shift_amount = {};
big_int_sub(&shift_amount, &f->Constant.value.value_integer, &b_lower_base);
BigInt value = {};
big_int_shl(&value, &one, &shift_amount);