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 21189bff33668f8b35e4ec32ab5d7ec2e74bbdc7..29d32606e32fc38e08ee76b1a49d91181c76881e 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 e9f957ba2224b7ec26e3c1dba6348b3736adfde8..13aac2c4e2c72d321141229a2f6e5ae0ab2c449a 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;
                                }
                        }