Add asserts, tracking Windows bug

This commit is contained in:
Christoffer Lerno
2026-01-23 11:51:51 +01:00
parent efa5bdc6df
commit 94a26d9483
2 changed files with 2 additions and 1 deletions

View File

@@ -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);

View File

@@ -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:;