Skip to content

Commit

Permalink
WIP: tweak ReadLocals
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Apr 22, 2018
1 parent a5c16c6 commit 05d78e8
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,18 +1287,19 @@ static UInt ReadLocals(TypSymbolSet follow, Obj nams, UInt narg)
/* init to avoid strange message in case of empty string */
STATE(Value)[0] = '\0';
Match( S_COMMA, ",", follow );
if (findValueInNams(nams, narg + 1, narg + nloc)) {
SyntaxError("Name used for two locals");
}
if (STATE(Symbol) == S_IDENT) {
if (findValueInNams(nams, narg + 1, narg + nloc)) {
SyntaxError("Name used for two locals");
}
start:
if (STATE(Symbol) == S_IDENT &&
findValueInNams(nams, 1, narg)) {
SyntaxError("Name used for argument and local");
}
nloc += 1;
PushPlist(nams, MakeImmString(STATE(Value)));
if (LEN_PLIST(nams) >= 65536) {
SyntaxError("Too many function arguments and locals");
if (findValueInNams(nams, 1, narg)) {
SyntaxError("Name used for argument and local");
}
nloc += 1;
PushPlist(nams, MakeImmString(STATE(Value)));
if (LEN_PLIST(nams) >= 65536) {
SyntaxError("Too many function arguments and locals");
}
}
Match( S_IDENT, "identifier", STATBEGIN|S_END|follow );
}
Expand Down

0 comments on commit 05d78e8

Please sign in to comment.