diff options
Diffstat (limited to 'gcc/genemit.c')
-rw-r--r-- | gcc/genemit.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/genemit.c b/gcc/genemit.c index 81eefa96cbc..ed7cd05be49 100644 --- a/gcc/genemit.c +++ b/gcc/genemit.c @@ -691,14 +691,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 |