re PR fortran/14129 ([g77] gcc/f/lex.c buffer size limitation.)
PR fortran/14129 * lex.c (ffelex_cfelex_): Avoid calling xrealloc on a local stack allocated array. From-SVN: r77849
This commit is contained in:
parent
af1967542f
commit
fb264fec48
@ -1,3 +1,9 @@
|
||||
2004-02-15 Roger Sayle <roger@eyesopen.com>
|
||||
|
||||
PR fortran/14129
|
||||
* lex.c (ffelex_cfelex_): Avoid calling xrealloc on a local stack
|
||||
allocated array.
|
||||
|
||||
2004-02-03 Kazu Hirata <kazu@cs.umass.edu>
|
||||
|
||||
* com.c (ffecom_member_phase2_): Use gen_rtx_MEM instead of
|
||||
|
16
gcc/f/lex.c
16
gcc/f/lex.c
@ -694,7 +694,13 @@ ffelex_cfelex_ (ffelexToken *xtoken, FILE *finput, int c)
|
||||
register unsigned bytes_used = (p - q);
|
||||
|
||||
buffer_length *= 2;
|
||||
q = xrealloc (q, buffer_length);
|
||||
if (q == &buff[0])
|
||||
{
|
||||
q = xmalloc (buffer_length);
|
||||
memcpy (q, buff, bytes_used);
|
||||
}
|
||||
else
|
||||
q = xrealloc (q, buffer_length);
|
||||
p = &q[bytes_used];
|
||||
r = &q[buffer_length];
|
||||
}
|
||||
@ -754,7 +760,13 @@ ffelex_cfelex_ (ffelexToken *xtoken, FILE *finput, int c)
|
||||
register unsigned bytes_used = (p - q);
|
||||
|
||||
buffer_length = bytes_used * 2;
|
||||
q = xrealloc (q, buffer_length);
|
||||
if (q == &buff[0])
|
||||
{
|
||||
q = xmalloc (buffer_length);
|
||||
memcpy (q, buff, bytes_used);
|
||||
}
|
||||
else
|
||||
q = xrealloc (q, buffer_length);
|
||||
p = &q[bytes_used];
|
||||
r = &q[buffer_length];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user