diff options
author | Chris Lattner <sabre@nondot.org> | 2004-07-06 23:25:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-07-06 23:25:19 +0000 |
commit | edfc49de13380102836cdb3d8def6e2aca3d8e52 (patch) | |
tree | b2f690b1ab0a04226749a6f55cd669dcdcc5591b | |
parent | d18a31d2fab7626bc3396106990d982a0b699b38 (diff) |
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
-rw-r--r-- | lib/VMCore/Type.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 50248f21e0..74542b8e44 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -402,6 +402,8 @@ FunctionType::FunctionType(const Type *Result, const std::vector<const Type*> &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)); |