From 94a26d9483493ce1f2de8d36cc0782d7983e5407 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Fri, 23 Jan 2026 11:51:51 +0100 Subject: [PATCH] Add asserts, tracking Windows bug --- src/compiler/number.c | 2 +- src/compiler/sema_const.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/number.c b/src/compiler/number.c index a32f9a0b8..21fa2c527 100644 --- a/src/compiler/number.c +++ b/src/compiler/number.c @@ -53,7 +53,7 @@ void expr_contract_array(ExprConst *expr_const, ConstKind contract_type) { if (expr_const->const_kind == CONST_SLICE && !expr_const->slice_init) { - *expr_const = (ExprConst) { .const_kind = contract_type }; + *expr_const = (ExprConst) { .const_kind = contract_type, .bytes.ptr = NULL, .bytes.len = 0 }; return; } ASSERT(expr_const->const_kind == CONST_INITIALIZER || expr_const->const_kind == CONST_SLICE); diff --git a/src/compiler/sema_const.c b/src/compiler/sema_const.c index bdbc9d798..b7a0198c5 100644 --- a/src/compiler/sema_const.c +++ b/src/compiler/sema_const.c @@ -145,6 +145,7 @@ static bool sema_concat_bytes_and_other(SemaContext *context, Expr *expr, Expr * { ArraySize len = left->const_expr.bytes.len; bool is_bytes = left->const_expr.const_kind == CONST_BYTES; + ASSERT(is_bytes || left->const_expr.const_kind == CONST_STRING); Type *indexed = type_get_indexed_type(left->type); const char *left_bytes = left->const_expr.bytes.ptr; RETRY:;