From 0b027d8601b90fe78813a68ea8e3938f7c87395e Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 2 Jul 2019 07:44:31 -0700 Subject: @(define): bugfix: incorrect parameter list walk. * parser.y (elem, define_clause): The match_reg_params function is supposed to walk the pattern function parameters, not the argument of the define directive (of which the second one is those arguments). This bug causes spurious unbound variable warnings when function bodies refer to their second or subsequent arguments. Issue reported by user vapnik spaknik. --- parser.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'parser.y') diff --git a/parser.y b/parser.y index c5e843fb..43f4f587 100644 --- a/parser.y +++ b/parser.y @@ -521,7 +521,7 @@ elem : texts { $$ = rlc(cons(text_s, $1), $1); | DEFINE exprs ')' elems END { $$ = list(define_s, t, $4, $2, nao); rl($$, num($1)); - match_reg_params($2); } + match_reg_params(second($2)); } ; clause_parts_h : elems_opt additional_parts_h { $$ = if2($1, cons($1, $2)); } @@ -536,7 +536,7 @@ define_clause : DEFINE exprs ')' newl clauses_opt END newl { $$ = list(define_s, $2, $5, nao); rl($$, num($1)); - match_reg_params($2); } + match_reg_params(second($2)); } | DEFINE ')' newl clauses_opt END newl { $$ = list(define_s, nil, $4, nao); -- cgit v1.2.3