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

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 14:44:37 PDT 2017


Merged to 5.0 in r310302.

This fixes a regression introduced in r308387, as reported on that
commit thread.

On Mon, Aug 7, 2017 at 1:39 PM, Hans Wennborg <hans at chromium.org> wrote:
> What's the rationale. Does the "Instruction does not dominate all
> uses!" failure occur on the 5.0 branch? I need more context.
>
> On Mon, Aug 7, 2017 at 8:18 AM, Kuba Mracek <mracek at apple.com> wrote:
>> Please merge into release_50.
>>
>> Thanks,
>> Kuba
>>
>>
>>> On 7 Aug 2017, at 00:12, Vitaly Buka via llvm-commits <llvm-commits at lists.llvm.org> wrote:
>>>
>>> Author: vitalybuka
>>> Date: Mon Aug  7 00:12:34 2017
>>> New Revision: 310241
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=310241&view=rev
>>> Log:
>>> [asan] Disable checking of arguments passed by value for --asan-force-dynamic-shadow
>>>
>>> Fails with "Instruction does not dominate all uses!"
>>>
>>> Modified:
>>>    llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
>>>    llvm/trunk/test/Instrumentation/AddressSanitizer/stack-poisoning-byval-args.ll
>>>
>>> Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=310241&r1=310240&r2=310241&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp (original)
>>> +++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Mon Aug  7 00:12:34 2017
>>> @@ -756,7 +756,8 @@ struct FunctionStackPoisoner : public In
>>>   bool runOnFunction() {
>>>     if (!ClStack) return false;
>>>
>>> -    if (ClRedzoneByvalArgs) copyArgsPassedByValToAllocas();
>>> +    if (ClRedzoneByvalArgs && !ClForceDynamicShadow)
>>> +      copyArgsPassedByValToAllocas();
>>>
>>>     // Collect alloca, ret, lifetime instructions etc.
>>>     for (BasicBlock *BB : depth_first(&F.getEntryBlock())) visit(*BB);
>>>
>>> Modified: llvm/trunk/test/Instrumentation/AddressSanitizer/stack-poisoning-byval-args.ll
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Instrumentation/AddressSanitizer/stack-poisoning-byval-args.ll?rev=310241&r1=310240&r2=310241&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/test/Instrumentation/AddressSanitizer/stack-poisoning-byval-args.ll (original)
>>> +++ llvm/trunk/test/Instrumentation/AddressSanitizer/stack-poisoning-byval-args.ll Mon Aug  7 00:12:34 2017
>>> @@ -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-gn
>>>
>>> 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 {
>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>


More information about the llvm-commits mailing list