<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 31, 2014 at 8:14 PM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">> On 2014 Aug 17, at 14:31, Hans Wennborg <<a href="mailto:hans@hanshq.net">hans@hanshq.net</a>> wrote:<br>
><br>
> Author: hans<br>
> Date: Sun Aug 17 13:31:18 2014<br>
> New Revision: 215841<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=215841&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=215841&view=rev</a><br>
> Log:<br>
> BumpPtrAllocator: remove 'no slabs allocated yet' check<br>
><br>
> We already handle the no-slabs case when checking whether the current slab<br>
> is large enough: if no slabs have been allocated, CurPtr and End are both 0.<br>
> alignPtr(0), will still be 0, and so "if (Ptr + Size <= End)" fails.<br>
<br>
</div>I don't think this commit introduces the problem, but isn't the result<br>
of `Ptr + Size` undefined when `Size` is too big?<br>
<br>
Should this be changed to `if (Size <= End - Ptr)`?</blockquote></div><br>Should check the pre-commit review here, I think I brought this up and there was some reason why it didn't make sense to fix it here....</div></div>