aboutsummaryrefslogtreecommitdiff
path: root/gcc/frame.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@gcc.gnu.org>2000-06-08 08:30:28 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2000-06-08 08:30:28 +0000
commit89d7f003d32b1ce78b154f42335ee97685245b0f (patch)
treebdea4eba48a082d99bdb2d830d19c8b50a655152 /gcc/frame.c
parent68c8e13efda181c139c48170058e8477fca68c6c (diff)
downloadgcc-89d7f003d32b1ce78b154f42335ee97685245b0f.zip
gcc-89d7f003d32b1ce78b154f42335ee97685245b0f.tar.gz
gcc-89d7f003d32b1ce78b154f42335ee97685245b0f.tar.bz2
frame.c (end_fde_sort): Remove extraneous erratic array test.
* frame.c (end_fde_sort): Remove extraneous erratic array test. * frame.c (start_fde_sort): Don't malloc (0). From-SVN: r34452
Diffstat (limited to 'gcc/frame.c')
-rw-r--r--gcc/frame.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/frame.c b/gcc/frame.c
index e1448e3..399df57 100644
--- a/gcc/frame.c
+++ b/gcc/frame.c
@@ -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
{