diff options
| author | Alexey Samsonov <vonosmas@gmail.com> | 2015-11-05 21:18:41 +0000 |
|---|---|---|
| committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-11-05 21:18:41 +0000 |
| commit | 55fda1be94c9d72e9d1239ee0e1c74e38253eb82 (patch) | |
| tree | 26ae08f3177ef60276959d4dccf14133ceb4aace /llvm/lib/Transforms/Instrumentation | |
| parent | db73c2f54c3ee974a662a6c196f38f73e6c3d42d (diff) | |
| download | bcm5719-llvm-55fda1be94c9d72e9d1239ee0e1c74e38253eb82.tar.gz bcm5719-llvm-55fda1be94c9d72e9d1239ee0e1c74e38253eb82.zip | |
[ASan] Disable instrumentation for inalloca variables.
inalloca variables were not treated as static allocas, therefore didn't
participate in regular stack instrumentation. We don't want them to
participate in dynamic alloca instrumentation as well.
llvm-svn: 252213
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 538cc850295..1c51264d737 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -840,7 +840,10 @@ bool AddressSanitizer::isInterestingAlloca(AllocaInst &AI) { getAllocaSizeInBytes(&AI) > 0 && // We are only interested in allocas not promotable to registers. // Promotable allocas are common under -O0. - (!ClSkipPromotableAllocas || !isAllocaPromotable(&AI))); + (!ClSkipPromotableAllocas || !isAllocaPromotable(&AI)) && + // inalloca allocas are not treated as static, and we don't want + // dynamic alloca instrumentation for them as well. + !AI.isUsedWithInAlloca()); ProcessedAllocas[&AI] = IsInteresting; return IsInteresting; |

