[qfcc] Override function declaration with definition

This fixes the problem of the function declaration parameter names
overriding the definition's parameter names.
This commit is contained in:
Bill Currie 2024-11-24 13:03:34 +09:00
parent ffcee99835
commit 53c4c205ca

View file

@ -839,10 +839,11 @@ function_symbol (specifier_t spec)
s = new_symbol (name); s = new_symbol (name);
s->sy_type = sy_func; s->sy_type = sy_func;
s->type = unalias_type (sym->type); s->type = unalias_type (sym->type);
s->params = sym->params;
s->metafunc = func;
symtab_addsymbol (current_symtab, s); symtab_addsymbol (current_symtab, s);
} }
//if it existed, override the declaration's parameters and metafunc
s->params = sym->params;
s->metafunc = func;
return s; return s;
} }