summaryrefslogtreecommitdiff
path: root/gcc/genextract.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/genextract.c')
-rw-r--r--gcc/genextract.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/genextract.c b/gcc/genextract.c
index 8c54f613f5b..a6ae3dfdbae 100644
--- a/gcc/genextract.c
+++ b/gcc/genextract.c
@@ -356,14 +356,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