diff options
author | Karl Schimpf <kschimpf@google.com> | 2015-09-03 16:18:32 +0000 |
---|---|---|
committer | Karl Schimpf <kschimpf@google.com> | 2015-09-03 16:18:32 +0000 |
commit | 44876c535f55650a25417b3dc589bd9372bd4fec (patch) | |
tree | 24ddfcda965063c4390beba3c9aae1fa1dc7da47 /llvm/lib/AsmParser | |
parent | e0495d987cd438bd37ff2a9b0b6d450943cbd7e2 (diff) | |
download | bcm5719-llvm-44876c535f55650a25417b3dc589bd9372bd4fec.tar.gz bcm5719-llvm-44876c535f55650a25417b3dc589bd9372bd4fec.zip |
Fix assertion failure in LLParser::ConvertValIDToValue
Summary:
Fixes bug 24645. Problem appears to be that the type may be undefined
when ConvertValIDToValue is called.
Reviewers: kcc
Subscribers: llvm-commits
llvm-svn: 246779
Diffstat (limited to 'llvm/lib/AsmParser')
-rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/AsmParser/LLParser.h | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index df34ba8697f..ac7207f99c4 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -4128,8 +4128,7 @@ bool LLParser::ConvertValIDToValue(Type *Ty, ValID &ID, Value *&V, V = PFS->GetVal(ID.StrVal, Ty, ID.Loc, OC); return V == nullptr; case ValID::t_InlineAsm: { - assert(ID.FTy); - if (!InlineAsm::Verify(ID.FTy, ID.StrVal2)) + if (!ID.FTy || !InlineAsm::Verify(ID.FTy, ID.StrVal2)) return Error(ID.Loc, "invalid type for inline asm constraint string"); V = InlineAsm::get(ID.FTy, ID.StrVal, ID.StrVal2, ID.UIntVal & 1, (ID.UIntVal >> 1) & 1, diff --git a/llvm/lib/AsmParser/LLParser.h b/llvm/lib/AsmParser/LLParser.h index e161f95248c..51ba7dec919 100644 --- a/llvm/lib/AsmParser/LLParser.h +++ b/llvm/lib/AsmParser/LLParser.h @@ -59,7 +59,7 @@ namespace llvm { LLLexer::LocTy Loc; unsigned UIntVal; - FunctionType *FTy; + FunctionType *FTy = nullptr; std::string StrVal, StrVal2; APSInt APSIntVal; APFloat APFloatVal{0.0}; |