[PATCH] D23708: [asan] Fix size of shadow incorrectly calculated in r279178

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 19 10:24:18 PDT 2016


reverted with r279277

On Fri, Aug 19, 2016 at 1:42 AM Vitaly Buka <vitalybuka at google.com> wrote:

> This revision was automatically updated to reflect the committed changes.
> Closed by commit rL279222: [asan] Fix size of shadow incorrectly
> calculated in r279178 (authored by vitalybuka).
>
> Changed prior to commit:
>   https://reviews.llvm.org/D23708?vs=68658&id=68659#toc
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D23708
>
> Files:
>   llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
>   llvm/trunk/test/Instrumentation/AddressSanitizer/stack-poisoning.ll
>
> Index: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
> ===================================================================
> --- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
> +++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
> @@ -2237,10 +2237,8 @@
>        IRBuilder<> IRBPoison(ThenTerm);
>        if (StackMallocIdx <= 4) {
>          int ClassSize = kMinStackMallocSize << StackMallocIdx;
> -        if ((int)ShadowBytesAfterReturn.size() != ClassSize) {
> -          ShadowBytesAfterReturn.resize(ClassSize,
> -                                        kAsanStackUseAfterReturnMagic);
> -        }
> +        ShadowBytesAfterReturn.resize(ClassSize >> Mapping.Scale,
> +                                      kAsanStackUseAfterReturnMagic);
>          poisonRedZones(ShadowBytesAfterReturn, IRBPoison, ShadowBase,
> true);
>          Value *SavedFlagPtrPtr = IRBPoison.CreateAdd(
>              FakeStack,
> Index: llvm/trunk/test/Instrumentation/AddressSanitizer/stack-poisoning.ll
> ===================================================================
> --- llvm/trunk/test/Instrumentation/AddressSanitizer/stack-poisoning.ll
> +++ llvm/trunk/test/Instrumentation/AddressSanitizer/stack-poisoning.ll
> @@ -44,6 +44,7 @@
>    ; CHECK-UAR: store i64 -723401728380766731
>    ; CHECK-UAR: store i64 -723401728380766731
>    ; CHECK-UAR: store i64 -723401728380766731
> +  ; CHECK-UAR-NOT: store i64
>    ; CHECK-UAR: store i8 0
>    ; CHECK-UAR-NOT: store
>    ; CHECK-UAR: label
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160819/115f696f/attachment.html>


More information about the llvm-commits mailing list