Fix lb_emit_ptr_offset

This commit is contained in:
gingerBill
2022-08-12 13:48:10 +01:00
parent 22d16c20f8
commit 8e7c7eeeba
3 changed files with 8 additions and 11 deletions

View File

@@ -1115,7 +1115,7 @@ Type *alloc_type_simd_vector(i64 count, Type *elem, Type *generic_count=nullptr)
////////////////////////////////////////////////////////////////
Type *type_deref(Type *t) {
Type *type_deref(Type *t, bool allow_multi_pointer=false) {
if (t != nullptr) {
Type *bt = base_type(t);
if (bt == nullptr) {
@@ -1132,6 +1132,11 @@ Type *type_deref(Type *t) {
GB_ASSERT(elem->kind == Type_Struct && elem->Struct.soa_kind != StructSoa_None);
return elem->Struct.soa_elem;
}
case Type_MultiPointer:
if (allow_multi_pointer) {
return bt->MultiPointer.elem;
}
break;
}
}
return t;