mirror of
https://github.com/ziglang/zig.git
synced 2025-12-25 23:53:15 +00:00
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. ```
This commit is contained in:
parent
e96f65db77
commit
18f05664dc
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user