aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFeoramund <161657516+Feoramund@users.noreply.github.com>2024-06-16 12:27:42 -0400
committerFeoramund <161657516+Feoramund@users.noreply.github.com>2024-06-16 12:27:42 -0400
commit78a5a27212a6b892e32e58a84ea0c25cd83fac3c (patch)
treec52216ac6f58c96871c0cab996fc79fb83ae151e /src
parent339bafe6ff649ad9c683a1d4afa212b7d2a649de (diff)
Fix `bit_set` construction crash on constant non-integer field
Diffstat (limited to 'src')
-rw-r--r--src/check_expr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 359b30276..e548eac88 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -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);