[PATCH] Add ASan hooks to BumpPtrAllocator

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 7 14:32:54 PST 2015


LGTM

On Mon, Dec 7, 2015 at 2:03 PM, Pete Cooper <peter_cooper at apple.com> wrote:

> Thanks for taking this on.  I got stuck at the clang error it found.
>
> LGTM, as it looks like you’ve fixed it the way Alexey requested in phab.
>
> Thanks,
> Pete
> > On Dec 7, 2015, at 1:28 PM, Justin Bogner <mail at justinbogner.com> wrote:
> >
> > (resending to correct list)
> >
> > Alexey Samsonov <vonosmas at gmail.com> writes:
> >> ================
> >> Comment at: include/llvm/Support/Allocator.h:229
> >> @@ +228,3 @@
> >> +      // Similarly, tell ASan about this space.
> >> +#if LLVM_ADDRESS_SANITIZER_BUILD
> >> +      ASAN_UNPOISON_MEMORY_REGION(AlignedPtr, Size);
> >> ----------------
> >> kcc wrote:
> >>> I don't like so many ifdefs.
> >>> Maybe like this?
> >>>
> >>> #if LLVM_ADDRESS_SANITIZER_BUILD
> >>> # include ...
> >>> #else
> >>>  #define ASAN_POISON_MEMORY_REGION(a,b)  /*empty*/
> >>> #endif
> >> In fact, it's worth defining this macro in llvm/Support/Compiler.h,
> >> similar to what we do for MSan interface function
> >> `__msan_allocated_memory`
> >
> > I was trying this out to see if it would catch a bug I saw, and happened
> > to clean it up to be more like we do the msan annotations. Okay to
> > commit the attached version?
> >
> > <asan-bpa.patch>
>
>


-- 
Alexey Samsonov
vonosmas at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151207/bebf2024/attachment.html>


More information about the llvm-commits mailing list