diff options
| author | Mikael Holmen <mikael.holmen@ericsson.com> | 2017-07-12 06:19:10 +0000 |
|---|---|---|
| committer | Mikael Holmen <mikael.holmen@ericsson.com> | 2017-07-12 06:19:10 +0000 |
| commit | ad7e718307a20c6e31ef2e2b54a69756188e3457 (patch) | |
| tree | 4b9f0d06aa67c95602c2f1b2144690e630a146e0 /llvm/lib/Support/Allocator.cpp | |
| parent | e970c2b706d19af3950beba3fe4eebeceed31feb (diff) | |
| download | bcm5719-llvm-ad7e718307a20c6e31ef2e2b54a69756188e3457.tar.gz bcm5719-llvm-ad7e718307a20c6e31ef2e2b54a69756188e3457.zip | |
[MemoryBuiltins] Allow truncation in visitAllocaInst()
Summary:
Solves PR33689.
If the pointer size is less than the size of the type used for the array
size in an alloca (the <ty> type below) then we could trigger the assert in
the PR. In that example we have pointer size i16 and <ty> is i32.
<result> = alloca [inalloca] <type> [, <ty> <NumElements>] [, align <alignment>]
Handle the situation by allowing truncation as well as zero extension in
ObjectSizeOffsetVisitor::visitAllocaInst().
Also, we now detect overflow in visitAllocaInst(), similar to how it was
already done in visitCallSite().
Reviewers: craig.topper, rnk, george.burgess.iv
Reviewed By: george.burgess.iv
Subscribers: davide, llvm-commits
Differential Revision: https://reviews.llvm.org/D35003
llvm-svn: 307754
Diffstat (limited to 'llvm/lib/Support/Allocator.cpp')
0 files changed, 0 insertions, 0 deletions

