public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug libstdc++/59829] Calling vector::data() occurs undefined behavior when the vector is empty [not found] <bug-59829-4@http.gcc.gnu.org/bugzilla/> @ 2014-01-20 11:18 ` redi at gcc dot gnu.org 2014-01-27 19:39 ` redi at gcc dot gnu.org ` (2 subsequent siblings) 3 siblings, 0 replies; 4+ messages in thread From: redi at gcc dot gnu.org @ 2014-01-20 11:18 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59829 Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-01-20 Component|c++ |libstdc++ Ever confirmed|0 |1 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libstdc++/59829] Calling vector::data() occurs undefined behavior when the vector is empty [not found] <bug-59829-4@http.gcc.gnu.org/bugzilla/> 2014-01-20 11:18 ` [Bug libstdc++/59829] Calling vector::data() occurs undefined behavior when the vector is empty redi at gcc dot gnu.org @ 2014-01-27 19:39 ` redi at gcc dot gnu.org 2014-01-29 14:58 ` redi at gcc dot gnu.org 2014-01-29 15:01 ` redi at gcc dot gnu.org 3 siblings, 0 replies; 4+ messages in thread From: redi at gcc dot gnu.org @ 2014-01-27 19:39 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59829 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- proposed fix: http://gcc.gnu.org/ml/gcc-patches/2014-01/msg01719.html ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libstdc++/59829] Calling vector::data() occurs undefined behavior when the vector is empty [not found] <bug-59829-4@http.gcc.gnu.org/bugzilla/> 2014-01-20 11:18 ` [Bug libstdc++/59829] Calling vector::data() occurs undefined behavior when the vector is empty redi at gcc dot gnu.org 2014-01-27 19:39 ` redi at gcc dot gnu.org @ 2014-01-29 14:58 ` redi at gcc dot gnu.org 2014-01-29 15:01 ` redi at gcc dot gnu.org 3 siblings, 0 replies; 4+ messages in thread From: redi at gcc dot gnu.org @ 2014-01-29 14:58 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59829 --- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- Author: redi Date: Wed Jan 29 14:57:42 2014 New Revision: 207241 URL: http://gcc.gnu.org/viewcvs?rev=207241&root=gcc&view=rev Log: PR libstdc++/59829 * include/bits/stl_vector.h (vector::data()): Call _M_data_ptr. (vector::_M_data_ptr): New overloaded functions to ensure empty vectors do not dereference the pointer. * testsuite/23_containers/vector/59829.cc: New. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Adjust dg-error line number. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. Added: trunk/libstdc++-v3/testsuite/23_containers/vector/59829.cc Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/bits/stl_vector.h trunk/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc trunk/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc trunk/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc trunk/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libstdc++/59829] Calling vector::data() occurs undefined behavior when the vector is empty [not found] <bug-59829-4@http.gcc.gnu.org/bugzilla/> ` (2 preceding siblings ...) 2014-01-29 14:58 ` redi at gcc dot gnu.org @ 2014-01-29 15:01 ` redi at gcc dot gnu.org 3 siblings, 0 replies; 4+ messages in thread From: redi at gcc dot gnu.org @ 2014-01-29 15:01 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59829 Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED Target Milestone|--- |4.9.0 --- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- Fixed for 4.9.0 I'm not planning to backport this, as it will only do any harm with user-defined allocators with custom pointer types, which are not widely used. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-01-29 15:01 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <bug-59829-4@http.gcc.gnu.org/bugzilla/> 2014-01-20 11:18 ` [Bug libstdc++/59829] Calling vector::data() occurs undefined behavior when the vector is empty redi at gcc dot gnu.org 2014-01-27 19:39 ` redi at gcc dot gnu.org 2014-01-29 14:58 ` redi at gcc dot gnu.org 2014-01-29 15:01 ` redi at gcc dot gnu.org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).