projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f0e1053
)
fix a small oversight that broke the fhourstones app.
author
Chris Lattner
<sabre@nondot.org>
Tue, 31 Jan 2012 05:18:56 +0000
(
05:18
+0000)
committer
Chris Lattner
<sabre@nondot.org>
Tue, 31 Jan 2012 05:18:56 +0000
(
05:18
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149357
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/VMCore/Constants.cpp
patch
|
blob
|
history
diff --git
a/lib/VMCore/Constants.cpp
b/lib/VMCore/Constants.cpp
index 624dc2ef3982f557417182bd8fe2f9d1bd85a385..39c96c714db754588475dde227058be743acbcb3 100644
(file)
--- 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<ConstantDataSequential>(this))
- return
CDS->getElementAsConstant(Elt)
;
+ return
Elt < CDS->getNumElements() ? CDS->getElementAsConstant(Elt) : 0
;
return 0;
}