[Bug libstdc++/50268] [C++0x] bitset doesn't sanitize input
marc.glisse at normalesup dot org
gcc-bugzilla@gcc.gnu.org
Fri Sep 2 11:00:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50268
--- Comment #11 from Marc Glisse <marc.glisse at normalesup dot org> 2011-09-02 10:59:46 UTC ---
(In reply to comment #10)
> (by the way, if you can see a neat enough way to improve _M_are_all_aux, you
> are welcome to propose it! I'm definitely not an expert in this area, and when
> I implemented it, I remember just quickly hacking something close to what we
> have elsewhere, which I could easily convince myself was correct)
all(), when it reaches the last chunk, checks
(nbchunk-1)*chunksize+popcount(lastchunk)==size(). It seems to me that it
should check instead lastchunk==mask (where mask is something like
~(~0UL<<extrabits), computed at compile-time). Because of the way things are
implemented, it means the helper needs to take mask (or extrabits) as argument.
More information about the Gcc-bugs
mailing list