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
This commit is contained in:
Chris Lattner 2012-01-31 05:18:56 +00:00
parent f0e1053a63
commit 7f2c6dc8a0

View File

@ -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;
}