<div dir="ltr">Yeah, that's true. I guess I just got caught by the mismatch between title and code.<div>It's really not a problem.<br><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"> Filipe<br></div></div>
<br><div class="gmail_quote">On Tue, Jul 7, 2015 at 1:24 PM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Jul 7, 2015 at 3:20 PM, Filipe Cabecinhas <<a href="mailto:filcab@gmail.com">filcab@gmail.com</a>> wrote:<br>
> Then why are you testing the size and not Str.Data()?<br>
><br>
> The semantic check should be for the nullptr.<br>
<br>
</span>Calling .Data() is superfluous, I think. If you have a size that is<br>
nonzero, the pointer had better not be nullptr or else other<br>
invariants are broken, I would guess.<br>
<span class="HOEnZb"><font color="#888888"><br>
~Aaron<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
> Thanks,<br>
><br>
> Filipe<br>
><br>
><br>
> On Tuesday, July 7, 2015, Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Passing a null pointer to memcpy is undefined behavior.<br>
>><br>
>><br>
>> Cheers,<br>
>> Rafael<br>
>><br>
>> _______________________________________________<br>
>> llvm-commits mailing list<br>
>> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
>><br>
><br>
><br>
> --<br>
> F<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
><br>
</div></div></blockquote></div><br></div></div></div>