mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
parse.y: check duplicated argument names; fix #5575
This commit is contained in:
@@ -299,6 +299,14 @@ static void
|
||||
local_add_f(parser_state *p, mrb_sym sym)
|
||||
{
|
||||
if (p->locals) {
|
||||
node *n = p->locals->car;
|
||||
while (n) {
|
||||
if (sym(n->car) == sym) {
|
||||
yyerror(p, "duplicated argument name");
|
||||
return;
|
||||
}
|
||||
n = n->cdr;
|
||||
}
|
||||
p->locals->car = push(p->locals->car, nsym(sym));
|
||||
}
|
||||
}
|
||||
|
||||
+1518
-1510
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user