From 6f429311c965b9b48b30e1583e2ba98f13bc6982 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 12 Feb 2023 22:02:38 +0900 Subject: [PATCH] [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. --- libs/util/cexpr-parse.y | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/util/cexpr-parse.y b/libs/util/cexpr-parse.y index caf460f05..900073038 100644 --- a/libs/util/cexpr-parse.y +++ b/libs/util/cexpr-parse.y @@ -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) {