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:
a270019
)
When creating constant arrays check that the initializer vector is the
author
Alkis Evlogimenos
<alkis@evlogimenos.com>
Wed, 15 Sep 2004 02:32:15 +0000
(
02:32
+0000)
committer
Alkis Evlogimenos
<alkis@evlogimenos.com>
Wed, 15 Sep 2004 02:32:15 +0000
(
02:32
+0000)
same size as the one in the array type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16354
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 8148f44b0331546a122f36f45be3f045673dd911..a029d8466bf42df7b33c203fdf27cdca03158fc0 100644
(file)
--- a/
lib/VMCore/Constants.cpp
+++ b/
lib/VMCore/Constants.cpp
@@
-245,6
+245,8
@@
ConstantFP::ConstantFP(const Type *Ty, double V) : Constant(Ty) {
ConstantArray::ConstantArray(const ArrayType *T,
const std::vector<Constant*> &V) : Constant(T) {
+ assert(V.size() == T->getNumElements() &&
+ "Invalid initializer vector for constant array");
Operands.reserve(V.size());
for (unsigned i = 0, e = V.size(); i != e; ++i) {
assert((V[i]->getType() == T->getElementType() ||