This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/50268] [C++0x] bitset doesn't sanitize input


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]