aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-03-03 17:21:55 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-03-03 17:21:55 -0500
commit2eafa7a4da020ca6a6ddfd29c70cc8c1f41493a3 (patch)
tree41fc984811b93c9f439ade60e8f9a86e28c236dd /compile.c
parentc607b97732c9922aa6fef3a0fe1055b028d5f0c2 (diff)
Fix issue with unnamed args getting name flag
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/compile.c b/compile.c
index 9b615bc4..d384a477 100644
--- a/compile.c
+++ b/compile.c
@@ -644,9 +644,9 @@ CORD compile(env_t *env, ast_t *ast)
// Pass 2: assign positional args
// Pass 3: compile and typecheck each arg
table_t arg_bindings = {};
- for (arg_ast_t *arg = args; arg; arg = arg->next) {
- if (arg->name)
- Table_str_set(&arg_bindings, arg->name, arg->value);
+ for (arg_ast_t *call_arg = args; call_arg; call_arg = call_arg->next) {
+ if (call_arg->name)
+ Table_str_set(&arg_bindings, call_arg->name, call_arg->value);
}
for (arg_ast_t *call_arg = args; call_arg; call_arg = call_arg->next) {
if (call_arg->name)