[llvm] r216044 - Fix an off by 1 bug that prevented SmallPtrSet from using all of its 'small' capacity. Then fix the early return in the move constructor that prevented 'small' moves from clearing the NumElements in the moved from object. The directed test missed this because it was always testing large moves due to the off by 1 bug.

Chandler Carruth chandlerc at google.com
Tue Aug 19 22:27:56 PDT 2014


On Tue, Aug 19, 2014 at 10:19 PM, Craig Topper <craig.topper at gmail.com>
wrote:

> Not sure how. How do can we verify if its still 'small' or not from
> outside?


I thought we had a way to test for that, mostly to check things in tests?

You can still verify it without that though: put objects in it that track
when they are moved (or copied) and move a set. When the set is small, it
will move the elements. When it is large, it will just re-point the
pointers.


> With the off by 1 fixed, the test did catch the bad move constructor.


Yea, it was just the off-by-one issue i was wondering about.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140819/f558e1e3/attachment.html>


More information about the llvm-commits mailing list