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 | b6917d2acc3f28a12aacc03347a22009c432f1c2 (patch) | |
tree | cf03d56eeb61cc00737c3f7a9a9244d09981c00e /llvm/lib/VMCore/Instructions.cpp | |
parent | 14f41bfc49817d407231a5120ef5b3bb6068842f (diff) | |
download | bcm5719-llvm-b6917d2acc3f28a12aacc03347a22009c432f1c2.tar.gz bcm5719-llvm-b6917d2acc3f28a12aacc03347a22009c432f1c2.zip |
Enforce that multiple return values have to have at least one result.
llvm-svn: 50137
Diffstat (limited to 'llvm/lib/VMCore/Instructions.cpp')
-rw-r--r-- | llvm/lib/VMCore/Instructions.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp index ad99c78c1ab..56bc8167c3c 100644 --- a/llvm/lib/VMCore/Instructions.cpp +++ b/llvm/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 |