Skip to content

Commit 7d7fea1

Browse files
committed
Start lifting some lli verification checks
1 parent ca83e1c commit 7d7fea1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/LLVM/PointerType.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ public struct PointerType: IRType {
2424
/// - parameter addressSpace: The optional address space where the pointed-to
2525
/// object resides.
2626
public init(pointee: IRType, addressSpace: Int = 0) {
27+
// FIXME: This class of invalid reference is not caught by Module.verify(),
28+
// only `lli`.
29+
if LLVMGetTypeKind(pointee.asLLVM()) == LLVMVoidTypeKind {
30+
fatalError("Attempted to form pointer to VoidType - use pointer to IntType.int8 instead")
31+
}
32+
2733
self.pointee = pointee
2834
self.addressSpace = addressSpace
2935
}

0 commit comments

Comments
 (0)