diff options
| author | Kostya Serebryany <kcc@google.com> | 2013-06-26 09:49:52 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2013-06-26 09:49:52 +0000 |
| commit | 5e276f9dbc7f298b8d182b44687e32fa36bbf148 (patch) | |
| tree | 861a82ce0ce4c65dcee66e18c5f94e607f9d1922 /llvm/lib | |
| parent | 9f5213f20f8103a43514672de82b5861d92328c1 (diff) | |
| download | bcm5719-llvm-5e276f9dbc7f298b8d182b44687e32fa36bbf148.tar.gz bcm5719-llvm-5e276f9dbc7f298b8d182b44687e32fa36bbf148.zip | |
[asan] workaround for PR16277: don't instrument AllocaInstr with alignment more than the redzone size
llvm-svn: 184928
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 67a8325b0cc..417fd76dc10 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -451,7 +451,7 @@ struct FunctionStackPoisoner : public InstVisitor<FunctionStackPoisoner> { StackAlignment = std::max(StackAlignment, AI.getAlignment()); AllocaVec.push_back(&AI); - uint64_t AlignedSize = getAlignedAllocaSize(&AI); + uint64_t AlignedSize = getAlignedAllocaSize(&AI); TotalStackSize += AlignedSize; } @@ -488,6 +488,7 @@ struct FunctionStackPoisoner : public InstVisitor<FunctionStackPoisoner> { bool isInterestingAlloca(AllocaInst &AI) { return (!AI.isArrayAllocation() && AI.isStaticAlloca() && + AI.getAlignment() <= RedzoneSize() && AI.getAllocatedType()->isSized()); } |

