summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Constants.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2012-01-31 05:18:56 +0000
committerChris Lattner <sabre@nondot.org>2012-01-31 05:18:56 +0000
commit06d673678ebfa500846ff0c6d4fdb1ba1c9523ec (patch)
tree18f5840e10877deb3373424b4f9239d883a4738f /llvm/lib/VMCore/Constants.cpp
parent997348e9fee7148a2d3f3830a8beecf740caf639 (diff)
downloadbcm5719-llvm-06d673678ebfa500846ff0c6d4fdb1ba1c9523ec.tar.gz
bcm5719-llvm-06d673678ebfa500846ff0c6d4fdb1ba1c9523ec.zip
fix a small oversight that broke the fhourstones app.
llvm-svn: 149357
Diffstat (limited to 'llvm/lib/VMCore/Constants.cpp')
-rw-r--r--llvm/lib/VMCore/Constants.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp
index 624dc2ef398..39c96c714db 100644
--- a/llvm/lib/VMCore/Constants.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud