mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-19 00:14:20 +00:00
Fix PR2113 by verifying allocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47792 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ad23d43f18
commit
ab3b77834c
@ -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);
|
||||
}
|
||||
|
||||
|
8
test/Verifier/2008-03-01-AllocaSized.ll
Normal file
8
test/Verifier/2008-03-01-AllocaSized.ll
Normal file
@ -0,0 +1,8 @@
|
||||
; RUN: not llvm-as -f %s -o /dev/null |& grep {Cannot allocate unsized type}
|
||||
; PR2113
|
||||
|
||||
define void @test() {
|
||||
%A = alloca void()
|
||||
ret void
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user