]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
frame.c (end_fde_sort): Remove extraneous erratic array test.
authorNathan Sidwell <nathan@gcc.gnu.org>
Thu, 8 Jun 2000 08:30:28 +0000 (08:30 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Thu, 8 Jun 2000 08:30:28 +0000 (08:30 +0000)
* frame.c (end_fde_sort): Remove extraneous erratic array test.

* frame.c (start_fde_sort): Don't malloc (0).

From-SVN: r34452

gcc/ChangeLog
gcc/frame.c

index e129114d1e2993f660b5c5149aee81a24899b167..51e6599575d7f729f9986c0104de345a264f99d4 100644 (file)
@@ -1,3 +1,11 @@
+2000-06-08  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * frame.c (end_fde_sort): Remove extraneous erratic array test.
+
+2000-06-08  Denis Perchine <dyp@perchine.com>
+
+       * frame.c (start_fde_sort): Don't malloc (0).
+
 2000-06-07  Zack Weinberg  <zack@wolery.cumb.org>
 
        * c-decl.c (pushdecl): Do not call COMPLETE_TYPE_P on
index e1448e315f0ade65690332fbf0dc177459e6626d..399df577ff0042dfe0a4a0b9f51b39d8d663fd85 100644 (file)
@@ -59,7 +59,7 @@ typedef struct fde_accumulator
 static inline int
 start_fde_sort (fde_accumulator *accu, size_t count)
 {
-  accu->linear.array = (fde **) malloc (sizeof (fde *) * count);
+  accu->linear.array = count ? (fde **) malloc (sizeof (fde *) * count) : NULL;
   accu->erratic.array = accu->linear.array ?
       (fde **) malloc (sizeof (fde *) * count) : NULL;
   accu->linear.count = 0;
@@ -230,8 +230,7 @@ end_fde_sort (fde_accumulator *accu, size_t count)
        abort ();
       frame_heapsort (&accu->erratic);
       fde_merge (&accu->linear, &accu->erratic);
-      if (accu->erratic.array)
-        free (accu->erratic.array);
+      free (accu->erratic.array);
     }
   else
     {