aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 79ad1c3..673cc27 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -5219,14 +5219,18 @@ xmalloc (size)
}
PTR
-xrealloc (ptr, size)
- PTR ptr;
+xrealloc (old, size)
+ PTR old;
size_t size;
{
- register PTR value = (PTR) realloc (ptr, size);
- if (value == 0)
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (ptr == 0)
fatal ("virtual memory exhausted");
- return value;
+ return ptr;
}
static char *