mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Bug when using +++ on value build a slice or array: the rhs cast was not done, corrupting data.
This commit is contained in:
@@ -72,6 +72,7 @@
|
||||
- Deref subscripts as needed for macro ref method arguments. #1789
|
||||
- Change ordering to simplify adding methods to type in conditional modules.
|
||||
- `#foo` style arguments were not type checked when given a type. #1790
|
||||
- Bug when using +++ on value build a slice or array: the rhs cast was not done.
|
||||
|
||||
### Stdlib changes
|
||||
- Increase BitWriter.write_bits limit up to 32 bits.
|
||||
|
||||
@@ -243,6 +243,7 @@ static bool sema_append_const_array_one(SemaContext *context, Expr *expr, Expr *
|
||||
ConstInitializer *init = is_slice ? list->const_expr.slice_init : list->const_expr.initializer;
|
||||
unsigned len = sema_len_from_const(list) + 1;
|
||||
Type *indexed = type_get_indexed_type(init->type);
|
||||
if (!cast_implicit(context, element, indexed, false)) return false;
|
||||
Type *new_inner_type = is_vector ? type_get_vector(indexed, len) : type_get_array(indexed, len);
|
||||
Type *new_outer_type = list->type;
|
||||
if (!is_slice)
|
||||
|
||||
Reference in New Issue
Block a user