diff options
author | Chris Lattner <sabre@nondot.org> | 2012-01-31 05:18:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2012-01-31 05:18:56 +0000 |
commit | 7f2c6dc8a032028d153c494b9d87846a3d37a9f5 (patch) | |
tree | 33e3e01a4a732b75476fb74a5ba5cebf8ad058a3 /lib | |
parent | f0e1053a63f5522ecfe1df8fe3ea07b24cb6b193 (diff) | |
download | external_llvm-7f2c6dc8a032028d153c494b9d87846a3d37a9f5.zip external_llvm-7f2c6dc8a032028d153c494b9d87846a3d37a9f5.tar.gz external_llvm-7f2c6dc8a032028d153c494b9d87846a3d37a9f5.tar.bz2 |
fix a small oversight that broke the fhourstones app.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149357 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Constants.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 624dc2e..39c96c7 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -176,7 +176,7 @@ Constant *Constant::getAggregateElement(unsigned Elt) const { return UV->getElementValue(Elt); if (const ConstantDataSequential *CDS =dyn_cast<ConstantDataSequential>(this)) - return CDS->getElementAsConstant(Elt); + return Elt < CDS->getNumElements() ? CDS->getElementAsConstant(Elt) : 0; return 0; } |