[ubsan] nonnull and returns_nonnull sanitization

Jakub Jelinek jakub at redhat.com
Tue Sep 9 04:49:43 PDT 2014


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).

	Jakub



More information about the llvm-commits mailing list