Merge pull request #7661 from louisnovy/fix-swizzle-through-pointer

Fix #7587: full length swizzles through a pointer keeping the pointer type
This commit is contained in:
gingerBill authored and GitHub committed 2026-09-29 13:06:24 +01:00
commit 8640b38899
4 files changed
+20 -2

No files matched your search

+2 -2
View File
@@ -5852,7 +5852,7 @@ gb_internal Type *determine_swizzle_array_type(Type *original_type, Type *type_h
Type *elem_type = array_type->Array.elem;
Type *swizzle_array_type = nullptr;
Type *bth = base_type(type_deref(type_hint));
Type *bth = base_type(type_hint);
if (bth != nullptr && bth->kind == Type_Array &&
bth->Array.count == new_count &&
are_types_identical(bth->Array.elem, elem_type)) {
@@ -5860,7 +5860,7 @@ gb_internal Type *determine_swizzle_array_type(Type *original_type, Type *type_h
} else {
i64 max_count = array_type->Array.count;
if (new_count == max_count) {
swizzle_array_type = original_type;
swizzle_array_type = type_deref(original_type);
} else {
swizzle_array_type = alloc_type_array(elem_type, new_count);
}