From 118630d9248415d8139d7df4147649bdadacbae9 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 7 Sep 2001 16:25:42 +0000 Subject: [PATCH] Add assertion to check for alloca [int] for example git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@429 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/iMemory.h | 5 +++++ 1 file changed, 5 insertions(+) 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!"); } }