[hackers] [scc] Use assign() to parse va_start last arg symbol || Michael Forney
commit 3e63b3f608ae6c6732758f6c55e316c3e341abde
Author: Michael Forney <mforney_AT_mforney.org>
AuthorDate: Wed Feb 15 23:30:16 2017 -0800
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Feb 16 08:44:49 2017 +0100
Use assign() to parse va_start last arg symbol
diff --git a/cc1/builtin.c b/cc1/builtin.c
index 7768df1..2361151 100644
--- a/cc1/builtin.c
+++ b/cc1/builtin.c
_AT_@ -58,21 +58,19 @@ static Node *
builtin_va_start(Symbol *sym)
{
Node *np, *ap, *last;
- Symbol **p, *lastsym;
+ Symbol **p;
Type *tp;
ap = assign();
expect(',');
- if (yytoken != IDEN)
+ last = assign();
+ if (last->op != OSYM)
goto error;
- lastsym = yylval.sym;
- last = varnode(lastsym);
- next();
- if (!valid_va_list(ap->type) || !(lastsym->flags&SDECLARED))
+ if (!valid_va_list(ap->type) || !(last->sym->flags&SDECLARED))
goto error;
- for (p = curfun->u.pars; p && *p != lastsym; ++p)
+ for (p = curfun->u.pars; p && *p != last->sym; ++p)
/* nothing */;
if (!p || *p == NULL || p[1] == NULL || p[1]->type != ellipsistype)
warn("second parameter of 'va_start' not last named argument");
Received on Thu Feb 16 2017 - 08:44:56 CET
This archive was generated by hypermail 2.3.0
: Thu Feb 16 2017 - 08:48:19 CET