Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion llvm/include/llvm/IR/DerivedTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,10 @@ class PointerType : public Type {
[[deprecated("PointerType::getUnqual with pointee type is pending removal. "
"Use Context overload.")]]
static PointerType *getUnqual(Type *ElementType) {
return PointerType::get(ElementType, 0);
assert(ElementType && "Can't get a pointer to <null> type!");
assert(isValidElementType(ElementType) &&
"Invalid type for pointer element!");
return PointerType::getUnqual(ElementType->getContext());
}

/// This constructs an opaque pointer to an object in the
Expand Down