vec.cc (__cxa_vec_new2): If the allocator returns NULL, return NULL.
authorJeffrey D. Oldham <oldham@codesourcery.com>
Wed, 10 Sep 2003 15:41:48 +0000 (15:41 +0000)
committerJeffrey D. Oldham <oldham@gcc.gnu.org>
Wed, 10 Sep 2003 15:41:48 +0000 (15:41 +0000)
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.

From-SVN: r71273

libstdc++-v3/ChangeLog
libstdc++-v3/libsupc++/vec.cc

index d99e42b4845956c3c2971b2a98726c2613889263..f046caac3cced608fac52019d1faf19cc74c341f 100644 (file)
@@ -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):
index d60cccee8c79ab28e2001fbe3f01cc68b8e0d0aa..e2c8f09df4bd9719bf4e298113fecbf947541a07 100644 (file)
@@ -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)
       {