Commit Graph

9 Commits

Author SHA1 Message Date
Jakub Jelinek a554497024 Update copyright years.
From-SVN: r267494
2019-01-01 13:31:55 +01:00
Jonathan Wakely c397f267f1 PR libstdc++/87784 fix dynamic_bitset::push_back
Previously the _M_Nb member was incremented before calling
_M_unchecked_set which meant that the bit being set was out of bounds.
It either set the wrong bit in an allocated word, or accessed beyond the
end of the allocated memory in the _M_w vector. The fix for the bug is
to update the _M_Nb member after using it as an index.

As an optimisation, when a new block needs to be appended the call to
_M_unchecked_set can be avoided by appending a block with the least
significant bit already set to the desired value.

	PR libstdc++/87784
	* include/tr2/dynamic_bitset (dynamic_bitset::push_back): When there
	are no unused bits in the last block, append a new block with the
	right value so the bit doesn't need to be set. Only increment size
	after setting the new bit, not before.
	* testsuite/tr2/dynamic_bitset/pr87784.cc: New test.

From-SVN: r265625
2018-10-30 14:49:32 +00:00
Jakub Jelinek 85ec4feb11 Update copyright years.
From-SVN: r256169
2018-01-03 11:03:58 +01:00
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Jonathan Wakely 52066eae5d Use effective-target instead of -std options
* testsuite/*: Use { target c++11 } or { target c++14 } instead of
	using -std in dg-options.

From-SVN: r239777
2016-08-26 12:41:37 +01:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Jakub Jelinek 5624e564d2 Update copyright years.
From-SVN: r219188
2015-01-05 13:33:28 +01:00
Richard Sandiford aa118a03c4 Update copyright years in libstdc++-v3/
From-SVN: r206301
2014-01-02 22:30:10 +00:00
Edward Smith-Rowland 6b8fe121af re PR libstdc++/58729 (tr2::dynamic_bitset::resize fails)
2013-10-18  Edward Smith-Rowland  <3dw4rd@verizon.net>

	PR libstdc++/58729
	* include/tr2/dynamic_bitset (_M_resize, resize): Use input value
	to set bits; (_M_do_left_shift, _M_do_right_shift, _M_do_to_ulong,
	_M_do_to_ullong, _M_do_find_first, _M_do_find_next, _M_copy_from_ptr,
	operator>>): Move long methods outline to...
	* include/tr2/dynamic_bitset.tcc: New.
	* include/Makefile.am: Add dynamic_bitset.tcc.
	* include/Makefile.in: Add dynamic_bitset.tcc.
	* testsuite/tr2/dynamic_bitset/pr58729.cc: New.

From-SVN: r203841
2013-10-19 01:31:19 +00:00