Fix reading the wrong symbol name when throw argument errors.

This commit is contained in:
David Anderson 2014-11-22 12:23:57 -08:00
parent 673ff572c5
commit 62c243f0a5
3 changed files with 4 additions and 2 deletions

View File

@ -5645,7 +5645,7 @@ static int declargs(symbol *sym, int chkshadow, const int *thistag)
if (argcnt>=sMAXARGS)
error(45);
if (decl.name[0] == PUBLIC_CHAR)
error(56,name); /* function arguments cannot be public */
error(56, decl.name); /* function arguments cannot be public */
if (decl.type.ident == iARRAY)
decl.type.ident = iREFARRAY;
@ -5659,7 +5659,7 @@ static int declargs(symbol *sym, int chkshadow, const int *thistag)
doarg(&decl,(argcnt+3)*sizeof(cell),fpublic,chkshadow,&arg);
if ((sym->usage & uPUBLIC) && arg.hasdefault)
error(59,name); /* arguments of a public function may not have a default value */
error(59, decl.name); /* arguments of a public function may not have a default value */
if ((sym->usage & uPROTOTYPED)==0) {
/* redimension the argument list, add the entry */

View File

@ -0,0 +1 @@
public x(param = 1) {}

View File

@ -0,0 +1 @@
(1) : error 059: function argument may not have a default value (variable "param")