mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- Empty ichar slice + byte concatenation hit an assert. #2789
This commit is contained in:
@@ -107,6 +107,7 @@
|
||||
- Recursive definition of tag not detected with nested tag/tagof #2790
|
||||
- Attrdef eval environment lacked rtype, causing error on invalid args #2797
|
||||
- $typeof(<type>) returns typeinfo, causing errors #2795.
|
||||
- Empty ichar slice + byte concatenation hit an assert. #2789
|
||||
|
||||
### Stdlib changes
|
||||
- Add `ThreadPool` join function to wait for all threads to finish in the pool without destroying the threads.
|
||||
|
||||
@@ -146,6 +146,8 @@ 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;
|
||||
Type *indexed = type_get_indexed_type(left->type);
|
||||
bool const_cast = sema_cast_const(right);
|
||||
ASSERT(const_cast);
|
||||
const char *left_bytes = left->const_expr.bytes.ptr;
|
||||
RETRY:;
|
||||
switch (right->const_expr.const_kind)
|
||||
|
||||
@@ -533,7 +533,8 @@ static bool sema_expr_analyse_designated_initializer(SemaContext *context, Type
|
||||
if (!result) return false;
|
||||
bool is_bitmember = member && member->decl_kind == DECL_VAR && member->var.kind == VARDECL_BITMEMBER;
|
||||
Expr *value = expr->designator_expr.value;
|
||||
if (!value && is_bitmember && member->var.start_bit == member->var.end_bit && type_flatten(result) == type_bool) {
|
||||
if (!value && is_bitmember && member->var.start_bit == member->var.end_bit && type_flatten(result) == type_bool)
|
||||
{
|
||||
ASSERT(is_bitstruct);
|
||||
value = expr_new_const_bool(INVALID_SPAN, type_bool, true);
|
||||
expr->designator_expr.value = value;
|
||||
|
||||
5
test/test_suite/compile_time/concat_slice_cast.c3t
Normal file
5
test/test_suite/compile_time/concat_slice_cast.c3t
Normal file
@@ -0,0 +1,5 @@
|
||||
fn int main()
|
||||
{
|
||||
const A = (ichar[]) { } +++ x'1234';
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user