[Bug c++/14176] New: standard allocator crashes when deallocating segment of zero length.
nivelle at mpi-sb dot mpg dot de
gcc-bugzilla@gcc.gnu.org
Tue Feb 17 14:14:00 GMT 2004
Hello,
I am not certain what the standard says about this, but the following code
causes a segmentation fault under various versions of g++ .
It is a bit strange off course to allocate segments of length 0, but
for symmetry it makes sense to allow it.
yours,
Hans.
#include <memory>
int main( int argc, char * argv[] )
{
unsigned int len = 0;
std::allocator< int > a;
int* p = a. allocate( len );
a. deallocate( p, len );
};
--
Summary: standard allocator crashes when deallocating segment of
zero length.
Product: gcc
Version: 3.2
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: nivelle at mpi-sb dot mpg dot de
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14176
More information about the Gcc-bugs
mailing list