gcc/libstdc++-v3
Jonathan Wakely 632183ddcc libstdc++: Avoid stack overflow in std::vector (PR 94540)
The std::__uninitialized_default_n algorithm used by std::vector creates
an initial object as a local variable then copies that into the
destination range. If the object is too large for the stack this
crashes. We should create the first object directly into the
destination and then copy it from there.

This doesn't fix the bug for C++98, because in that case the initial
value is created as a default argument of the vector constructor i.e. in
the user's code, not inside libstdc++. We can't prevent that.

	PR libstdc++/94540
	* include/bits/stl_uninitialized.h (__uninitialized_default_1<true>):
	Construct the first value at *__first instead of on the stack.
	(__uninitialized_default_n_1<true>): Likewise.
	Improve comments on several of the non-standard algorithms.
	* testsuite/20_util/specialized_algorithms/uninitialized_default/94540.cc:
	New test.
	* testsuite/20_util/specialized_algorithms/uninitialized_default_n/94540.cc:
	New test.
	* testsuite/20_util/specialized_algorithms/uninitialized_value_construct/94540.cc:
	New test.
	* testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/94540.cc:
	New test.
	* testsuite/23_containers/vector/cons/94540.cc: New test.
2020-06-17 22:49:06 +01:00
..
config Update the baseline symbols for SPARC64/Linux 2020-05-07 10:56:51 +02:00
doc libstdc++: Document API changes in GCC 10 2020-06-01 16:50:53 +01:00
include libstdc++: Avoid stack overflow in std::vector (PR 94540) 2020-06-17 22:49:06 +01:00
libsupc++ libstdc++: Fix the return type of __cxa_finalize 2020-05-04 23:07:19 +01:00
po
python
scripts
src libstdc++: Fix istream::ignore discarding too many chars (PR 94749) 2020-06-11 18:41:37 +01:00
testsuite libstdc++: Avoid stack overflow in std::vector (PR 94540) 2020-06-17 22:49:06 +01:00
acinclude.m4
aclocal.m4
ChangeLog Daily bump. 2020-06-17 00:16:36 +00:00
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
config.h.in
configure Check for more missing math decls on vxworks. 2020-05-31 14:32:27 -07:00
configure.ac
configure.host
crossconfig.m4 Check for more missing math decls on vxworks. 2020-05-31 14:32:27 -07:00
fragment.am
linkage.m4
Makefile.am
Makefile.in
README

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.