[PATCH] D27659: [sanitizer] intercept bstring functions

Kostya Serebryany via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 09:54:52 PST 2016


kcc added a comment.

In https://reviews.llvm.org/D27659#625093, @kcwu wrote:

> In https://reviews.llvm.org/D27659#624707, @kcc wrote:
>
> > please see internal b/33656003 about what went wrong with this patch (other than the Mac failure).
> >  Also I've noticed that  bzer_test.cc does not actually test anything -- it passes w/o the patch. 
> >  Probably you explained it here: https://github.com/google/sanitizers/issues/750#issuecomment-266262859
>
>
> bzero_test.cc is easy to fix (adding -std=c99). But I am not sure how to properly fix the problem of WRAP though.  Does following approach work?
>
> Proposal: a separate CL dedicated for WRAP() issue.
>
> 1. extract the body of "INTERCEPTOR(void*, memcpy, void *dst, const void *src, uptr size) {" to a macro.
> 2. replace all WRAP(memcpy) by the macro.
> 3. repeat for others functions WRAP(*). Any suggestions?


Yes, this should work. 
I would actually suggest that you do this only for the functions you change now. 
If we need to fix the older interceptors, it's our yak to shave.


https://reviews.llvm.org/D27659





More information about the llvm-commits mailing list