[llvm-commits] [llvm] r149357 - /llvm/trunk/lib/VMCore/Constants.cpp
Chris Lattner
sabre at nondot.org
Mon Jan 30 21:18:57 PST 2012
Author: lattner
Date: Mon Jan 30 23:18:56 2012
New Revision: 149357
URL: http://llvm.org/viewvc/llvm-project?rev=149357&view=rev
Log:
fix a small oversight that broke the fhourstones app.
Modified:
llvm/trunk/lib/VMCore/Constants.cpp
Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=149357&r1=149356&r2=149357&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Mon Jan 30 23:18:56 2012
@@ -176,7 +176,7 @@
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;
}
More information about the llvm-commits
mailing list