Commit fb264fec by Roger Sayle Committed by Roger Sayle

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
parent af196754
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
......
......@@ -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];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment