Commit f5d236de by Jeffrey A Law Committed by Jeff Law

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
parent 0d9009fd
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
......
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