diff --git a/include/llvm/iMemory.h b/include/llvm/iMemory.h index 5062cb61af4..5667da6c8ff 100644 --- a/include/llvm/iMemory.h +++ b/include/llvm/iMemory.h @@ -33,6 +33,11 @@ public: Operands.reserve(1); Operands.push_back(Use(ArraySize, this)); + } else { + // Make sure that the pointer is not to an unsized array! + assert(!getType()->getValueType()->isArrayType() || + ((const ArrayType*)getType()->getValueType())->isSized() && + "Trying to allocate unsized array without size!"); } }