[Bug libstdc++/37818] std::vector copy construction of empty vector causes malloc of size 1

paolo dot carlini at oracle dot com gcc-bugzilla@gcc.gnu.org
Mon Oct 13 17:52:00 GMT 2008



------- Comment #1 from paolo dot carlini at oracle dot com  2008-10-13 17:51 -------
This is already fixed in the current release series, 4.3.x:

2007-09-06  Paolo Carlini  <pcarlini@suse.de>

        * include/bits/stl_vector.h (_Vector_base<>::_M_allocate):
        Do not call _M_impl.allocate when __n == 0.
        * testsuite/23_containers/vector/zero_sized_allocations.cc: New.


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
          Component|c++                         |libstdc++
 GCC target triplet| x86_64-unknown-linux-gnu   |x86_64-unknown-linux-gnu
      Known to work|                            |4.3.1
         Resolution|                            |WORKSFORME


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37818



More information about the Gcc-bugs mailing list