| ... | @@ -762,7 +762,7 @@ pub const DeclGen = struct { | ... | @@ -762,7 +762,7 @@ pub const DeclGen = struct { |
| 762 | } | 762 | } |
| 763 | const llvm_addrspace = dg.llvmAddressSpace(t.ptrAddressSpace()); | 763 | const llvm_addrspace = dg.llvmAddressSpace(t.ptrAddressSpace()); |
| 764 | const elem_ty = t.childType(); | 764 | const elem_ty = t.childType(); |
| 765 | const llvm_elem_ty = if (elem_ty.hasCodeGenBits()) | 765 | const llvm_elem_ty = if (elem_ty.hasCodeGenBits() or elem_ty.zigTypeTag() == .Array) |
| 766 | try dg.llvmType(elem_ty) | 766 | try dg.llvmType(elem_ty) |
| 767 | else | 767 | else |
| 768 | dg.context.intType(8); | 768 | dg.context.intType(8); |
| ... | @@ -1475,7 +1475,7 @@ pub const DeclGen = struct { | ... | @@ -1475,7 +1475,7 @@ pub const DeclGen = struct { |
| 1475 | } | 1475 | } |
| 1476 | | 1476 | |
| 1477 | const llvm_type = try self.llvmType(tv.ty); | 1477 | const llvm_type = try self.llvmType(tv.ty); |
| 1478 | if (!tv.ty.childType().hasCodeGenBits()) { | 1478 | if (!tv.ty.childType().hasCodeGenBits() or !decl.ty.hasCodeGenBits()) { |
| 1479 | return self.lowerPtrToVoid(tv.ty); | 1479 | return self.lowerPtrToVoid(tv.ty); |
| 1480 | } | 1480 | } |
| 1481 | | 1481 | |
| ... | @@ -1497,7 +1497,7 @@ pub const DeclGen = struct { | ... | @@ -1497,7 +1497,7 @@ pub const DeclGen = struct { |
| 1497 | // for non-optional pointers. We also need to respect the alignment, even though | 1497 | // for non-optional pointers. We also need to respect the alignment, even though |
| 1498 | // the address will never be dereferenced. | 1498 | // the address will never be dereferenced. |
| 1499 | const llvm_usize = try dg.llvmType(Type.usize); | 1499 | const llvm_usize = try dg.llvmType(Type.usize); |
| 1500 | const llvm_ptr_ty = dg.context.intType(8).pointerType(0); | 1500 | const llvm_ptr_ty = try dg.llvmType(ptr_ty); |
| 1501 | if (alignment != 0) { | 1501 | if (alignment != 0) { |
| 1502 | return llvm_usize.constInt(alignment, .False).constIntToPtr(llvm_ptr_ty); | 1502 | return llvm_usize.constInt(alignment, .False).constIntToPtr(llvm_ptr_ty); |
| 1503 | } | 1503 | } |