[ubsan] nonnull and returns_nonnull sanitization

Alexey Samsonov vonosmas at gmail.com
Wed Sep 10 11:39:43 PDT 2014


On Tue, Sep 9, 2014 at 4:49 AM, Jakub Jelinek <jakub at redhat.com> wrote:

> On Mon, Sep 08, 2014 at 01:32:02PM -0700, Alexey Samsonov wrote:
> > OK. I've submitted the patches to Clang and UBSan runtime which implement
> > -fsanitize=nonnull-attribute and -fsanitize=returns-nonnull-attribute
> (the
> > last
> > commit is r217400). I've added source locations of attribute
> declarations to
> > the static data passed in UBSan handlers to print them in the error
> > reports: it makes
> > sense to actually show user the declaration which forbids
> passing/returning
> > null pointer.
> > This location is also added to returns-nonull attribute, because the
> > attribute might be
> > declared far from the actual function definition with incorrect
> > return-statement.
>
> Also:
> RECOVERABLE(nonnull_arg, NonNullArgData *Data);
> shouldn't have the trailing semicolon, it results in GCC pedantic warning
> about it (no other RECOVERABLE uses have the trailing semicolon).
>

Yeah, I've noticed and fixed it in LLVM r217407.


>
>         Jakub
>



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


More information about the llvm-commits mailing list