diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-01-21 17:47:36 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-01-21 17:47:36 +0000 |
commit | 3e42b5cbb2142972859ba66522bfc604aa06a15d (patch) | |
tree | 50ef143756292df471dad464af598c9175f80804 /gcc/genextract.c | |
parent | 591ff8a577bff58d216825d7456b7959d0c66cbf (diff) | |
download | gcc-3e42b5cbb2142972859ba66522bfc604aa06a15d.tar.gz |
* 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
Diffstat (limited to 'gcc/genextract.c')
-rw-r--r-- | gcc/genextract.c | 14 |
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 |