mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-19 13:39:46 +08:00
cccp.c (macroexpand): Avoid out of range accesses for omitted arguments.
* cccp.c (macroexpand): Avoid out of range accesses for omitted arguments. From-SVN: r30289
This commit is contained in:
parent
0d9009fd94
commit
f5d236de11
@ -1,3 +1,8 @@
|
||||
Sun Oct 31 01:53:30 1999 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* cccp.c (macroexpand): Avoid out of range accesses for omitted
|
||||
arguments.
|
||||
|
||||
Sat Oct 30 22:42:50 1999 Stephen L Moshier <moshier@mediaone.net>
|
||||
|
||||
* c-lex.c (yylex): Accept 'f' in mantissa of hex float constant.
|
||||
|
@ -8581,7 +8581,12 @@ macroexpand (hp, op)
|
||||
Also count number of times each arg is used. */
|
||||
xbuf_len = defn->length;
|
||||
for (ap = defn->pattern; ap != NULL; ap = ap->next) {
|
||||
if (ap->stringify)
|
||||
if (ap->stringify && args[ap->argno].stringified_length_bound == 0)
|
||||
/* macarg is not called for omitted arguments, as a result
|
||||
stringified_length_bound will be zero. We need to make
|
||||
enough space for "". */
|
||||
xbuf_len += 2;
|
||||
else if (ap->stringify)
|
||||
xbuf_len += args[ap->argno].stringified_length_bound;
|
||||
else if (ap->raw_before != 0 || ap->raw_after != 0 || traditional)
|
||||
/* Add 4 for two newline-space markers to prevent
|
||||
|
Loading…
Reference in New Issue
Block a user