]> granicus.if.org Git - llvm/commitdiff
Merging r310241 and r310242:
authorHans Wennborg <hans@hanshq.net>
Mon, 7 Aug 2017 21:48:12 +0000 (21:48 +0000)
committerHans Wennborg <hans@hanshq.net>
Mon, 7 Aug 2017 21:48:12 +0000 (21:48 +0000)
------------------------------------------------------------------------
r310241 | vitalybuka | 2017-08-07 00:12:34 -0700 (Mon, 07 Aug 2017) | 3 lines

[asan] Disable checking of arguments passed by value for --asan-force-dynamic-shadow

Fails with "Instruction does not dominate all uses!"
------------------------------------------------------------------------

------------------------------------------------------------------------
r310242 | vitalybuka | 2017-08-07 00:35:33 -0700 (Mon, 07 Aug 2017) | 1 line

[asan] Fix asan dynamic shadow check before copyArgsPassedByValToAllocas
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_50@310309 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/AddressSanitizer.cpp
test/Instrumentation/AddressSanitizer/stack-poisoning-byval-args.ll

index 057f746e052d2255f101c29ec6be0aebc40b78fd..f8d255273b2a84982fc409c9cdc2ab5372fec4d3 100644 (file)
@@ -756,7 +756,8 @@ struct FunctionStackPoisoner : public InstVisitor<FunctionStackPoisoner> {
   bool runOnFunction() {
     if (!ClStack) return false;
 
-    if (ClRedzoneByvalArgs) copyArgsPassedByValToAllocas();
+    if (ClRedzoneByvalArgs && Mapping.Offset != kDynamicShadowSentinel)
+      copyArgsPassedByValToAllocas();
 
     // Collect alloca, ret, lifetime instructions etc.
     for (BasicBlock *BB : depth_first(&F.getEntryBlock())) visit(*BB);
index 32610ce3b815ca8df04d4dc97c01b998df2bcb6a..8531cb9632487303d87990e954520bbf7180dc95 100644 (file)
@@ -1,5 +1,7 @@
 ; This check verifies that arguments passed by value get redzones.
 ; RUN: opt < %s -asan -asan-realign-stack=32 -S | FileCheck %s
+; RUN: opt < %s -asan -asan-realign-stack=32 -asan-force-dynamic-shadow -S | FileCheck %s --check-prefixes=CHECK-FDS
+
 
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
 target triple = "x86_64-unknown-linux-gnu"
@@ -8,6 +10,8 @@ target triple = "x86_64-unknown-linux-gnu"
 
 declare i32 @bar(%struct.A*)
 
+; CHECK-FDS-NOT: {{\.byval}}
+
 ; Test behavior for named argument with explicit alignment.  The memcpy and
 ; alloca alignments should match the explicit alignment of 64.
 define void @foo(%struct.A* byval align 64 %a) sanitize_address {