diff options
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/vec.cc | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d99e42b..f046caa 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2003-09-10 Jeffrey D. Oldham <oldham@codesourcery.com> + + * libsupc++/vec.cc (__cxa_vec_new2): If the allocator returns + NULL, return NULL. This reflects a C++ ABI change 2003 Sep 05. + (__cxa_vec_new3): Likewise. + 2003-09-10 Petur Runolfsson <peturr02@ru.is> * include/bits/fstream.tcc (basic_filebuf::seekoff): diff --git a/libstdc++-v3/libsupc++/vec.cc b/libstdc++-v3/libsupc++/vec.cc index d60ccce..e2c8f09 100644 --- a/libstdc++-v3/libsupc++/vec.cc +++ b/libstdc++-v3/libsupc++/vec.cc @@ -1,6 +1,6 @@ // New abi Support -*- C++ -*- -// Copyright (C) 2000, 2001 Free Software Foundation, Inc. +// Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -83,7 +83,9 @@ namespace __cxxabiv1 { std::size_t size = element_count * element_size + padding_size; char *base = static_cast <char *> (alloc (size)); - + if (!base) + return base; + if (padding_size) { base += padding_size; @@ -116,6 +118,8 @@ namespace __cxxabiv1 { std::size_t size = element_count * element_size + padding_size; char *base = static_cast<char *>(alloc (size)); + if (!base) + return base; if (padding_size) { |