cccp.c (xrealloc): Call malloc given a NULL old pointer.
* 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. From-SVN: r24806
This commit is contained in:
parent
d202e8aa05
commit
470b68c0a9
@ -1,3 +1,13 @@
|
||||
Thu Jan 21 17:45:18 1999 Richard Henderson <rth@cygnus.com>
|
||||
|
||||
* configure.in ({rs6000|powerpc}-ibm-aix4.[12]*): Add missing `then'.
|
||||
|
||||
* 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.
|
||||
|
||||
Thu Jan 21 19:44:55 1999 Michael Meissner <meissner@cygnus.com>
|
||||
|
||||
* configure.in ({rs6000|powerpc}-ibm-aix4.[12]*): If
|
||||
|
@ -10743,7 +10743,11 @@ xrealloc (old, size)
|
||||
PTR old;
|
||||
size_t size;
|
||||
{
|
||||
register PTR ptr = (PTR) realloc (old, size);
|
||||
register PTR ptr;
|
||||
if (ptr)
|
||||
ptr = (PTR) realloc (old, size);
|
||||
else
|
||||
ptr = (PTR) malloc (size);
|
||||
if (!ptr)
|
||||
memory_full ();
|
||||
return ptr;
|
||||
|
@ -531,14 +531,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;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -60,7 +60,11 @@ xrealloc (old, size)
|
||||
PTR old;
|
||||
size_t size;
|
||||
{
|
||||
register PTR ptr = (PTR) realloc (old, size);
|
||||
register PTR ptr;
|
||||
if (ptr)
|
||||
ptr = (PTR) realloc (old, size);
|
||||
else
|
||||
ptr = (PTR) malloc (size);
|
||||
if (ptr == 0)
|
||||
memory_full ();
|
||||
return ptr;
|
||||
|
14
gcc/gcc.c
14
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 *
|
||||
|
@ -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
|
||||
|
@ -5753,14 +5753,18 @@ extend_range (range, min, max)
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
PTR
|
||||
|
@ -68,14 +68,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
|
||||
|
@ -257,14 +257,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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -188,14 +188,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
|
||||
|
@ -293,14 +293,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
|
||||
|
@ -914,14 +914,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
|
||||
|
@ -396,14 +396,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
|
||||
|
@ -1671,14 +1671,18 @@ xstrdup (input)
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
PTR
|
||||
|
@ -5710,7 +5710,11 @@ xrealloc (ptr, size)
|
||||
PTR ptr;
|
||||
size_t size;
|
||||
{
|
||||
register PTR result = (PTR) realloc (ptr, size);
|
||||
register PTR result;
|
||||
if (ptr)
|
||||
result = (PTR) realloc (ptr, size);
|
||||
else
|
||||
result = (PTR) malloc (size);
|
||||
if (!result)
|
||||
fatal ("Virtual memory exhausted.");
|
||||
|
||||
|
@ -608,7 +608,11 @@ xrealloc (old_space, byte_count)
|
||||
pointer_type old_space;
|
||||
size_t byte_count;
|
||||
{
|
||||
register pointer_type rv = (pointer_type) realloc (old_space, byte_count);
|
||||
register pointer_type rv;
|
||||
if (old_space)
|
||||
rv = (pointer_type) realloc (old_space, byte_count);
|
||||
else
|
||||
rv = (pointer_type) malloc (byte_count);
|
||||
if (rv == NULL)
|
||||
{
|
||||
fprintf (stderr, "\n%s: virtual memory exceeded\n", pname);
|
||||
|
Loading…
Reference in New Issue
Block a user