diff options
author | Chris Lattner <sabre@nondot.org> | 2011-08-07 04:18:48 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-08-07 04:18:48 +0000 |
commit | f4ef8db7cd71edabe424f9d5c7d3ee23ef9924d5 (patch) | |
tree | 093fbf326021e4ea04599f161906cd79e2d6107e | |
parent | 69145baf36219b07a49d8ce14b4a04870e72a123 (diff) | |
download | external_llvm-f4ef8db7cd71edabe424f9d5c7d3ee23ef9924d5.zip external_llvm-f4ef8db7cd71edabe424f9d5c7d3ee23ef9924d5.tar.gz external_llvm-f4ef8db7cd71edabe424f9d5c7d3ee23ef9924d5.tar.bz2 |
strengthen up an assertion: you can't create a constant struct
with an opaque struct type, it doesn't make sense. This should
resolve PR10473.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137028 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/VMCore/Constants.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 9d0f7cc..2f22cda 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -652,7 +652,7 @@ ConstantStruct::ConstantStruct(StructType *T, ArrayRef<Constant *> V) : Constant(T, ConstantStructVal, OperandTraits<ConstantStruct>::op_end(this) - V.size(), V.size()) { - assert((T->isOpaque() || V.size() == T->getNumElements()) && + assert(V.size() == T->getNumElements() && "Invalid initializer vector for constant structure"); for (unsigned i = 0, e = V.size(); i != e; ++i) assert((T->isOpaque() || V[i]->getType() == T->getElementType(i)) && @@ -672,7 +672,7 @@ Constant *ConstantStruct::get(StructType *ST, ArrayRef<Constant*> V) { return ConstantAggregateZero::get(ST); } -Constant* ConstantStruct::get(StructType *T, ...) { +Constant *ConstantStruct::get(StructType *T, ...) { va_list ap; SmallVector<Constant*, 8> Values; va_start(ap, T); |