projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
AsmParser: Validate alloca's type
[oota-llvm.git]
/
lib
/
AsmParser
/
LLParser.cpp
diff --git
a/lib/AsmParser/LLParser.cpp
b/lib/AsmParser/LLParser.cpp
index adf4c9073ab87ade648eb62a775b77661e3937c7..7af85b5846cddc11dbeb7f2d6d2e040fbf8ee595 100644
(file)
--- a/
lib/AsmParser/LLParser.cpp
+++ b/
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) {