aboutsummaryrefslogtreecommitdiff
path: root/gcc/genattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/genattr.c')
-rw-r--r--gcc/genattr.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/genattr.c b/gcc/genattr.c
index b676be5..348de94 100644
--- a/gcc/genattr.c
+++ b/gcc/genattr.c
@@ -210,14 +210,18 @@ xmalloc (size)
}
PTR
-xrealloc (ptr, size)
- PTR ptr;
+xrealloc (old, size)
+ PTR old;
size_t size;
{
- register PTR result = (PTR) realloc (ptr, size);
- if (!result)
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (!ptr)
fatal ("virtual memory exhausted");
- return result;
+ return ptr;
}
static void