mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-21 05:45:19 +00:00
Fix more #soa changes
This commit is contained in:
@@ -4993,6 +4993,9 @@ gb_internal lbAddr lb_build_addr_internal(lbProcedure *p, Ast *expr) {
|
||||
if (sub_sel.index.count > 0) {
|
||||
item = lb_emit_deep_field_gep(p, item, sub_sel);
|
||||
}
|
||||
// make sure it's ^T and not [^]T
|
||||
item.type = alloc_type_multi_pointer_to_pointer(item.type);
|
||||
|
||||
return lb_addr(item);
|
||||
} else if (addr.kind == lbAddr_Swizzle) {
|
||||
GB_ASSERT(sel.index.count > 0);
|
||||
|
||||
@@ -1292,6 +1292,7 @@ gb_internal lbValue lb_addr_load(lbProcedure *p, lbAddr const &addr) {
|
||||
if (t->Struct.soa_kind == StructSoa_Fixed) {
|
||||
len = lb_const_int(p->module, t_int, t->Struct.soa_count);
|
||||
} else {
|
||||
elem = alloc_type_multi_pointer_to_pointer(elem);
|
||||
lbValue v = lb_emit_load(p, addr.addr);
|
||||
len = lb_soa_struct_len(p, v);
|
||||
}
|
||||
|
||||
@@ -999,6 +999,17 @@ gb_internal Type *alloc_type_pointer_to_multi_pointer(Type *ptr) {
|
||||
return original_type;
|
||||
}
|
||||
|
||||
gb_internal Type *alloc_type_multi_pointer_to_pointer(Type *ptr) {
|
||||
Type *original_type = ptr;
|
||||
ptr = base_type(ptr);
|
||||
if (ptr->kind == Type_MultiPointer) {
|
||||
return alloc_type_pointer(ptr->MultiPointer.elem);
|
||||
} else if (ptr->kind != Type_Pointer) {
|
||||
GB_PANIC("Invalid type: %s", type_to_string(original_type));
|
||||
}
|
||||
return original_type;
|
||||
}
|
||||
|
||||
gb_internal Type *alloc_type_array(Type *elem, i64 count, Type *generic_count = nullptr) {
|
||||
if (generic_count != nullptr) {
|
||||
Type *t = alloc_type(Type_Array);
|
||||
|
||||
Reference in New Issue
Block a user