Skip to content

Commit 0cf822c

Browse files
authored
Merge pull request #90 from CodaFi/low-level-verified-module
Lift some lli verification checks
2 parents ca83e1c + 9320fd9 commit 0cf822c

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 pointee is VoidType {
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)