Fix missing argument values
This commit is contained in:
parent
4d15d9cc6b
commit
567c3d8dc2
15
ell.c
15
ell.c
|
@ -756,11 +756,12 @@ execute_args (struct context *ctx, struct item *args, struct item **res) {
|
||||||
struct item *evaluated = NULL;
|
struct item *evaluated = NULL;
|
||||||
if (!execute_statement (ctx, args, &evaluated))
|
if (!execute_statement (ctx, args, &evaluated))
|
||||||
return false;
|
return false;
|
||||||
if (evaluated) {
|
// Arguments should not evaporate, default to a nil value
|
||||||
item_free_list (evaluated->next);
|
if (!evaluated && !check (ctx, (evaluated = new_list (NULL))))
|
||||||
evaluated->next = NULL;
|
return false;
|
||||||
res = &(*res = evaluated)->next;
|
item_free_list (evaluated->next);
|
||||||
}
|
evaluated->next = NULL;
|
||||||
|
res = &(*res = evaluated)->next;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -806,8 +807,8 @@ execute_statement
|
||||||
if (statement->type == ITEM_STRING)
|
if (statement->type == ITEM_STRING)
|
||||||
return check (ctx, (*result = new_clone (statement)));
|
return check (ctx, (*result = new_clone (statement)));
|
||||||
|
|
||||||
// XXX: should this ever happen and what are the consequences?
|
// Executing a nil value results in no value. It's not very different from
|
||||||
// Shouldn't we rather clone the empty list?
|
// calling a block that returns no value--it's for our callers to resolve.
|
||||||
struct item *body;
|
struct item *body;
|
||||||
if (!(body = statement->head))
|
if (!(body = statement->head))
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue