mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Fix: Fixed #soa arrays
This commit is contained in:
+11
-2
@@ -102,6 +102,7 @@ gb_internal Type * check_init_variable (CheckerContext *c, Entity *
|
|||||||
gb_internal void check_assignment_error_suggestion(CheckerContext *c, Operand *o, Type *type, i64 max_bit_size=0);
|
gb_internal void check_assignment_error_suggestion(CheckerContext *c, Operand *o, Type *type, i64 max_bit_size=0);
|
||||||
gb_internal void add_map_key_type_dependencies(CheckerContext *ctx, Type *key);
|
gb_internal void add_map_key_type_dependencies(CheckerContext *ctx, Type *key);
|
||||||
|
|
||||||
|
gb_internal Type *make_soa_struct_fixed(CheckerContext *ctx, Ast *array_typ_expr, Ast *elem_expr, Type *elem, i64 count, Type *generic_type);
|
||||||
gb_internal Type *make_soa_struct_slice(CheckerContext *ctx, Ast *array_typ_expr, Ast *elem_expr, Type *elem);
|
gb_internal Type *make_soa_struct_slice(CheckerContext *ctx, Ast *array_typ_expr, Ast *elem_expr, Type *elem);
|
||||||
gb_internal Type *make_soa_struct_dynamic_array(CheckerContext *ctx, Ast *array_typ_expr, Ast *elem_expr, Type *elem);
|
gb_internal Type *make_soa_struct_dynamic_array(CheckerContext *ctx, Ast *array_typ_expr, Ast *elem_expr, Type *elem);
|
||||||
|
|
||||||
@@ -1409,11 +1410,19 @@ gb_internal bool is_polymorphic_type_assignable(CheckerContext *c, Type *poly, T
|
|||||||
poly->Struct.soa_kind != StructSoa_None) {
|
poly->Struct.soa_kind != StructSoa_None) {
|
||||||
bool ok = is_polymorphic_type_assignable(c, poly->Struct.soa_elem, source->Struct.soa_elem, true, modify_type);
|
bool ok = is_polymorphic_type_assignable(c, poly->Struct.soa_elem, source->Struct.soa_elem, true, modify_type);
|
||||||
if (ok) switch (source->Struct.soa_kind) {
|
if (ok) switch (source->Struct.soa_kind) {
|
||||||
case StructSoa_Fixed:
|
|
||||||
default:
|
default:
|
||||||
GB_PANIC("Unhandled SOA Kind");
|
GB_PANIC("Unhandled SOA Kind");
|
||||||
break;
|
break;
|
||||||
|
case StructSoa_Fixed:
|
||||||
|
if (modify_type) {
|
||||||
|
bool breakpoint = true;
|
||||||
|
Type *type = make_soa_struct_fixed(
|
||||||
|
c, nullptr, poly->Struct.node,
|
||||||
|
poly->Struct.soa_elem, poly->Struct.soa_count,
|
||||||
|
nullptr);
|
||||||
|
gb_memmove(poly, type, gb_size_of(*type));
|
||||||
|
}
|
||||||
|
break;
|
||||||
case StructSoa_Slice:
|
case StructSoa_Slice:
|
||||||
if (modify_type) {
|
if (modify_type) {
|
||||||
Type *type = make_soa_struct_slice(c, nullptr, poly->Struct.node, poly->Struct.soa_elem);
|
Type *type = make_soa_struct_slice(c, nullptr, poly->Struct.node, poly->Struct.soa_elem);
|
||||||
|
|||||||
Reference in New Issue
Block a user