From: Chris Lattner Date: Tue, 6 Jul 2004 23:25:19 +0000 (+0000) Subject: Make sure people don't make functiontypes with an invalid return type X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=edfc49de13380102836cdb3d8def6e2aca3d8e52;p=oota-llvm.git Make sure people don't make functiontypes with an invalid return type git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14654 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 50248f21e07..74542b8e44b 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -402,6 +402,8 @@ FunctionType::FunctionType(const Type *Result, const std::vector &Params, bool IsVarArgs) : DerivedType(FunctionTyID), isVarArgs(IsVarArgs) { + assert((Result->isFirstClassType() || Result == Type::VoidTy) && + "LLVM functions cannot return aggregates"); bool isAbstract = Result->isAbstract(); ContainedTys.reserve(Params.size()+1); ContainedTys.push_back(PATypeHandle(Result, this));