From 3e42b5cbb2142972859ba66522bfc604aa06a15d Mon Sep 17 00:00:00 2001 From: rth Date: Thu, 21 Jan 1999 17:47:36 +0000 Subject: * cccp.c (xrealloc): Call malloc given a NULL old pointer. * collect2.c, cppalloc.c, gcc.c, genattr.c, genattrtab.c: Likewise. * gencodes.c, genconfig.c, genemit.c, genextract.c: Likewise. * genflags.c, genopinit.c, genoutput.c, genpeep.c: Likewise. * genrecog.c, mips-tfile.c, protoize.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24806 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/gcc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'gcc/gcc.c') diff --git a/gcc/gcc.c b/gcc/gcc.c index 79ad1c38527..673cc275460 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 * -- cgit v1.2.1