I put up a CL to remove the assert<br><br><a href="https://reviews.llvm.org/D24904">https://reviews.llvm.org/D24904</a><br><br>I'm not seeing much objection to this proposal but I posted on a weekend, so maybe someone will have something to say now.  If there's no objections I'll wait a few hours after getting an lgtm to commit <br><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Sep 26, 2016 at 2:54 AM Joerg Sonnenberger via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sun, Sep 25, 2016 at 04:10:24PM +0000, Zachary Turner via llvm-dev wrote:<br class="gmail_msg">
> 2) [nullptr, nullptr+0) is a valid range.  Why shouldn't we be able to<br class="gmail_msg">
> construct a StringRef from an otherwise perfectly valid range?<br class="gmail_msg">
<br class="gmail_msg">
The problem is that for a lot of functions, esp. the mem* family, NULL<br class="gmail_msg">
as argument is triggering UB, even if size is 0. Since the GNU folks<br class="gmail_msg">
started to attribute the functions like that, certain compilers will<br class="gmail_msg">
pretty aggressively fold code based on that.<br class="gmail_msg">
<br class="gmail_msg">
Joerg<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
LLVM Developers mailing list<br class="gmail_msg">
<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="gmail_msg">
</blockquote></div>