scc

suckless C compiler
git clone git://git.suckless.org/scc
Log | Files | Refs | README | LICENSE

commit 59165d9e6a8a1c8aa7b65d0b50976cd71cd7c788
parent 33b9f7476c6f730def0034b2b36ad14dde30d2f2
Author: Quentin Rameau <quinq@fifth.space>
Date:   Tue,  7 Mar 2017 12:03:25 +0100

[cc1] Fix limits checking in functions declaration

Diffstat:
cc1/decl.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cc1/decl.c b/cc1/decl.c @@ -351,7 +351,7 @@ static Symbol *dodcl(int rep, Type *type); static int -krargs(Symbol *pars[], unsigned *nparsp) +krpars(Symbol *pars[], unsigned *nparsp) { Symbol *sym; int toomany = 0; @@ -367,7 +367,7 @@ krargs(Symbol *pars[], unsigned *nparsp) yylval.sym->name); continue; } - if (npars < NR_FUNARG) { + if (npars < NR_FUNPARAM) { ++npars; *pars++ = sym; continue; @@ -388,7 +388,7 @@ krfun(struct declarators *dp, if (yytoken != ')') - toomany = krargs(pars, nparsp); + toomany = krpars(pars, nparsp); else *nparsp = 0; @@ -434,7 +434,7 @@ ansifun(struct declarators *dp, } if (sym) { - if (npars == NR_FUNARG) { + if (npars == NR_FUNPARAM) { toomany = 1; } else { npars++;