This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/50268] [C++0x] bitset doesn't sanitize input
- From: "marc.glisse at normalesup dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 02 Sep 2011 10:59:46 +0000
- Subject: [Bug libstdc++/50268] [C++0x] bitset doesn't sanitize input
- Auto-submitted: auto-generated
- References: <bug-50268-4@http.gcc.gnu.org/bugzilla/>
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.