From: Chris Lattner Date: Tue, 31 Jan 2012 05:18:56 +0000 (+0000) Subject: fix a small oversight that broke the fhourstones app. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=7f2c6dc8a032028d153c494b9d87846a3d37a9f5;p=oota-llvm.git 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 --- diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 624dc2ef398..39c96c714db 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(this)) - return CDS->getElementAsConstant(Elt); + return Elt < CDS->getNumElements() ? CDS->getElementAsConstant(Elt) : 0; return 0; }