Commit 18f05664dc

Jacob Young <jacobly0@users.noreply.github.com>
2022-12-19 03:53:49
llvm: avoid creating an invalid llvm type
Fixes the following assertion: ``` zig: llvm/lib/IR/Type.cpp:729: static llvm::PointerType* llvm::PointerType::get(llvm::Type*, unsigned int): Assertion `isValidElementType(EltTy) && "Invalid type for pointer element!"' failed. ```
1 parent e96f65d
Changed files (1)
src
codegen
src/codegen/llvm.zig
@@ -4125,7 +4125,7 @@ pub const DeclGen = struct {
             else => unreachable,
         };
         if (bitcast_needed) {
-            return llvm_ptr.constBitCast((try dg.lowerType(ptr_child_ty)).pointerType(0));
+            return llvm_ptr.constBitCast((try dg.lowerPtrElemTy(ptr_child_ty)).pointerType(0));
         } else {
             return llvm_ptr;
         }