set_stmt/set_func: fix validation
authorMichael Wallner <mike@php.net>
Fri, 13 Oct 2017 08:13:27 +0000 (10:13 +0200)
committerMichael Wallner <mike@php.net>
Fri, 13 Oct 2017 08:13:27 +0000 (10:13 +0200)
src/types/set_func.c
src/types/set_stmt.c

index 21189bf..29d3260 100644 (file)
@@ -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,
index e9f957b..13aac2c 100644 (file)
@@ -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;
                                }
                        }