diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-23 05:36:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-23 05:36:34 +0000 |
commit | d52b62ae05f75032cdc2077a320d0a4934b2b27f (patch) | |
tree | 0200818d46df5105c863dbd65b2099d7b99a32fe /lib/VMCore/Instructions.cpp | |
parent | 69e6317083fd15096845c7c2602854d4d769717f (diff) |
Enforce that multiple return values have to have at least one result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50137 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instructions.cpp')
-rw-r--r-- | lib/VMCore/Instructions.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index ad99c78c1a..56bc8167c3 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -2691,7 +2691,7 @@ bool GetResultInst::isValidOperands(const Value *Aggregate, unsigned Index) { if (const StructType *STy = dyn_cast<StructType>(Aggregate->getType())) { unsigned NumElements = STy->getNumElements(); - if (Index >= NumElements) + if (Index >= NumElements || NumElements == 0) return false; // getresult aggregate value's element types are restricted to |