From: Michael Wallner Date: Fri, 13 Oct 2017 08:13:27 +0000 (+0200) Subject: set_stmt/set_func: fix validation X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=de9b3ba972626195328a82bb108cac86312bd288;p=m6w6%2Fext-psi set_stmt/set_func: fix validation --- diff --git a/src/types/set_func.c b/src/types/set_func.c index 21189bf..29d3260 100644 --- a/src/types/set_func.c +++ b/src/types/set_func.c @@ -204,7 +204,7 @@ static inline bool psi_set_func_validate_to_recursive(struct psi_data *data, bool psi_set_func_validate(struct psi_data *data, struct psi_set_func *func, struct psi_set_exp *set, struct psi_impl *impl, struct psi_decl *cb_decl) { - if (!psi_decl_var_validate(data, func->var, NULL, impl->decl, NULL, set) + if (!psi_decl_var_validate(data, func->var, impl, impl->decl, NULL, set) && !psi_decl_var_validate(data, func->var, NULL, cb_decl, NULL, NULL) && !psi_impl_get_temp_let_arg(impl, func->var)) { data->error(data, func->var->token, PSI_WARNING, diff --git a/src/types/set_stmt.c b/src/types/set_stmt.c index e9f957b..13aac2c 100644 --- a/src/types/set_stmt.c +++ b/src/types/set_stmt.c @@ -86,11 +86,11 @@ bool psi_set_stmts_validate(struct psi_data *data, struct psi_impl *impl) case PSI_SET_NUMEXP: break; case PSI_SET_FUNC: - if (!psi_decl_get_arg(impl->decl, set->exp->data.func->var)) { + if (!psi_impl_get_decl_arg(impl, set->exp->data.func->var)) { if (!psi_impl_get_temp_let_arg(impl, set->exp->data.func->var)) { data->error(data, set->token, PSI_WARNING, "Unknown variable '%s' of `set` statement of implementation '%s'", - set->exp->data.func->var, impl->func->name); + set->exp->data.func->var->name, impl->func->name); return false; } }