summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser/LLParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.cpp')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index adf4c9073ab..7af85b5846c 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -4633,6 +4633,9 @@ int LLParser::ParseAlloc(Instruction *&Inst, PerFunctionState &PFS) {
if (ParseType(Ty)) return true;
+ if (!PointerType::isValidElementType(Ty))
+ return TokError("pointer to this type is invalid");
+
bool AteExtraComma = false;
if (EatIfPresent(lltok::comma)) {
if (Lex.getKind() == lltok::kw_align) {
OpenPOWER on IntegriCloud