<div dir="ltr"><div class="gmail_extra">+Richard Smith</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 11, 2014 at 1:25 AM, Jakub Jelinek <span dir="ltr"><<a href="mailto:jakub@redhat.com" target="_blank">jakub@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="">On Tue, Jul 29, 2014 at 07:43:33PM -0700, Alexey Samsonov wrote:<br>

> Once again, sorry for the delay =/<br>
><br>
> I hope to get to this patch this/next week.<br>
<br>
</div>Would it be acceptable to just get the libubsan bits in right now<br>
(either the patch I've posted, or some minor wording differences or whatever<br>
you'd like to change) and get the clang side done when you find time for it?<br></blockquote><div><br></div><div>Right, let's do it. I've just mailed first bit (implementation of returns-nonnull check) for review: <a href="http://reviews.llvm.org/D4849">http://reviews.llvm.org/D4849</a></div>
<div><br></div><div>I believe there are things to reach agreement on, though. Let's discuss it now:</div><div><br></div><div>1) Frontend flag naming. We can add new values: -fsanitize=returns-nonnull and -fsanitize=nonnull. But it looks confusing to</div>
<div>me: having both "-fsanitize=null" and "-fsanitize=nonnull" is weird. Clang user manual tells that -fsanitize=null detects</div><div>"Use of a null pointer or creation of a null reference." Maybe, we should just put both new checks under "-fsanitize=null"</div>
<div>and make manual say "invalid use of a null pointer or creation of a null reference". Passing null pointer to function annotated</div><div>with __attribute__((nonnull)) conforms to "invalid use of a null pointer". As an alternative, we can introduce new "-fsanitize=nonnull-attributes" for</div>
<div>both new checks.</div><div><br></div><div>2) Handler arguments. Is there any particular reason to not include ArgNo into NonNullArgData? Is it done to reduce the number of function calls / basic blocks?</div><div>Another question is the meaning of SourceLocation in NonNullArgData and NonNullRetData. I assume that SourceLocation in the first one should point to the</div>
<div>invalid call of function with attributes, while SourceLocation in the second one should point to the bad return statement inside the function with attributes. Is that so?</div><div><br></div></div>-- <br><div dir="ltr">
Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div>
</div></div>