diff options
author | Chris Lattner <sabre@nondot.org> | 2008-03-01 09:01:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-03-01 09:01:57 +0000 |
commit | ab3b77834c9232e4c13acb29afe1920b97c5a20b (patch) | |
tree | db93a0a14cfea9591f27830c990cdbe24922a392 /lib | |
parent | ad23d43f1895522b1b6a000fdf46bb118dd3a93e (diff) |
Fix PR2113 by verifying allocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47792 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index e86c89bfa8..575bb82df7 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -1041,9 +1041,12 @@ void Verifier::visitStoreInst(StoreInst &SI) { } void Verifier::visitAllocationInst(AllocationInst &AI) { - const PointerType *Ptr = AI.getType(); - Assert(Ptr->getAddressSpace() == 0, - "Allocation instruction pointer not in the generic address space!"); + const PointerType *PTy = AI.getType(); + Assert1(PTy->getAddressSpace() == 0, + "Allocation instruction pointer not in the generic address space!", + &AI); + Assert1(PTy->getElementType()->isSized(), "Cannot allocate unsized type", + &AI); visitInstruction(AI); } |