Added a check for rubbish after parameters in a function defintion.
git-svn-id: http://picoc.googlecode.com/svn/trunk@322 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
parent
eb6f323f06
commit
6f00c2a853
3
parse.c
3
parse.c
|
@ -86,6 +86,9 @@ struct Value *ParseFunctionDefinition(struct ParseState *Parser, struct ValueTyp
|
||||||
ProgramFail(&ParamParser, "comma expected");
|
ProgramFail(&ParamParser, "comma expected");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (FuncValue->Val->FuncDef.NumParams != 0 && Token != TokenCloseBracket && Token != TokenComma && Token != TokenEllipsis)
|
||||||
|
ProgramFail(&ParamParser, "bad parameter");
|
||||||
|
|
||||||
if (!IsPrototype)
|
if (!IsPrototype)
|
||||||
{
|
{
|
||||||
if (LexGetToken(Parser, NULL, FALSE) != TokenLeftBrace)
|
if (LexGetToken(Parser, NULL, FALSE) != TokenLeftBrace)
|
||||||
|
|
Loading…
Reference in a new issue