OSDN Git Service

reject PR3281:crash01.ll with:
authorChris Lattner <sabre@nondot.org>
Mon, 5 Jan 2009 08:00:30 +0000 (08:00 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 5 Jan 2009 08:00:30 +0000 (08:00 +0000)
llvm-as: crash01.ll:1:9: invalid function return type
declare opaque @t()
        ^

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61678 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AsmParser/LLParser.cpp

index d2ce6ec..12bb659 100644 (file)
@@ -2035,7 +2035,8 @@ bool LLParser::ParseFunctionHeader(Function *&Fn, bool isDefine) {
     return Error(LinkageLoc, "invalid function linkage type");
   }
   
-  if (!FunctionType::isValidReturnType(RetType))
+  if (!FunctionType::isValidReturnType(RetType) ||
+      isa<OpaqueType>(RetType))
     return Error(RetTypeLoc, "invalid function return type");
   
   if (Lex.getKind() != lltok::GlobalVar)