[PATCH] D23481: [Asan] Unpoison red zones even if use-after-scope was disabled with runtime flag

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 12 18:00:53 PDT 2016


vitalybuka created this revision.
vitalybuka added a reviewer: eugenis.
vitalybuka added a subscriber: llvm-commits.

PR27453

https://reviews.llvm.org/D23481

Files:
  lib/Transforms/Instrumentation/AddressSanitizer.cpp

Index: lib/Transforms/Instrumentation/AddressSanitizer.cpp
===================================================================
--- lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -2186,12 +2186,13 @@
   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);
     }
   };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23481.67950.patch
Type: text/x-patch
Size: 831 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160813/14be18f8/attachment.bin>


More information about the llvm-commits mailing list