+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
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];
}
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];
}