mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-04 05:31:51 +00:00
When creating constant arrays check that the initializer vector is the
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
This commit is contained in:
parent
a2700194ae
commit
e0de1d64be
@ -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() ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user