From 7f2c6dc8a032028d153c494b9d87846a3d37a9f5 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 31 Jan 2012 05:18:56 +0000 Subject: [PATCH] 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 --- lib/VMCore/Constants.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.34.1