Fix assertion failure in LLParser::ConvertValIDToValue
[oota-llvm.git] / lib / AsmParser / LLParser.cpp
index df34ba8697faee42ca4c0da9c25582057d88f886..ac7207f99c4f3417d0549ce0d199cb72e7b1235c 100644 (file)
@@ -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,