summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-07-02 07:44:31 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-07-02 07:44:31 -0700
commit259719b2d57d6ed36350dd12560c428e64911cca (patch)
tree3d9d6eb65d96172e2573ed63ff6f706e6264fd93
parentf8f2d5017dc22bcdcffcfc7558cf5d4e1b7898a1 (diff)
downloadtxr-259719b2d57d6ed36350dd12560c428e64911cca.tar.gz
txr-259719b2d57d6ed36350dd12560c428e64911cca.tar.bz2
txr-259719b2d57d6ed36350dd12560c428e64911cca.zip
@(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.
-rw-r--r--parser.y4
1 files changed, 2 insertions, 2 deletions
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);