[cexpr] Use func instead of result type for end of list

While the cexpr parser itself doesn't support void functions, they have
their uses when used with the system, and mixing them into the list of
function overloads shouldn't break non-void functions.
This commit is contained in:
Bill Currie 2023-02-12 22:02:38 +09:00
parent 2748f1c9f7
commit 6f429311c9

View file

@ -390,7 +390,10 @@ static exprval_t *function_expr (exprsym_t *fsym, exprlist_t *list,
*(int *) result->value = 0;
return result;
}
for (exprfunc_t *f = fsym->value; f->result; f++) {
for (exprfunc_t *f = fsym->value; f->func; f++) {
if (!f->result) {
continue;
}
int num_params = f->num_params;
if (num_params >= 0 && num_args == num_params) {
} else if (num_params < 0 && num_args >= ~num_params) {