summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2016-08-16 16:24:10 +0000
committerVitaly Buka <vitalybuka@google.com>2016-08-16 16:24:10 +0000
commit1ce73ef11c7a00e20f8c46ac66fa6cf272c28682 (patch)
treeaa37b64f63b7e1ce5def0cd9ca70e5089fee948e /llvm/lib/Transforms
parent1e5b2d1611fbaf46b004b80f3800729ec68b2a6b (diff)
downloadbcm5719-llvm-1ce73ef11c7a00e20f8c46ac66fa6cf272c28682.tar.gz
bcm5719-llvm-1ce73ef11c7a00e20f8c46ac66fa6cf272c28682.zip
[Asan] Unpoison red zones even if use-after-scope was disabled with runtime flag
Summary: PR27453 Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23481 llvm-svn: 278818
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index 5a1cf103354..58e552710b7 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -2186,12 +2186,13 @@ void FunctionStackPoisoner::poisonStack() {
poisonRedZones(L.ShadowBytes, IRB, ShadowBase, true);
auto UnpoisonStack = [&](IRBuilder<> &IRB) {
+ // Do this always as poisonAlloca can be disabled with
+ // detect_stack_use_after_scope=0.
+ poisonRedZones(L.ShadowBytes, IRB, ShadowBase, false);
if (HavePoisonedStaticAllocas) {
// If we poisoned some allocas in llvm.lifetime analysis,
// unpoison whole stack frame now.
poisonAlloca(LocalStackBase, LocalStackSize, IRB, false);
- } else {
- poisonRedZones(L.ShadowBytes, IRB, ShadowBase, false);
}
};
OpenPOWER on IntegriCloud