validate: check anonymous decl
authorMichael Wallner <mike@php.net>
Tue, 5 Sep 2017 06:51:39 +0000 (08:51 +0200)
committerMichael Wallner <mike@php.net>
Tue, 5 Sep 2017 06:51:39 +0000 (08:51 +0200)
src/types/decl.c

index 95122ab1d9dad9112f172324f534abd1999b9ae2..51dd733350b49073fbf4befc921426e1718c5633 100644 (file)
@@ -85,6 +85,10 @@ static inline bool psi_decl_validate_func(struct psi_data *data,
 {
        struct psi_func_redir *redir;
 
+       if (!func->var->name) {
+               data->error(data, func->token, PSI_WARNING, "Anonymous decl!");
+               return false;
+       }
        if (!strcmp(func->var->name, "dlsym")) {
                data->error(data, func->token, PSI_WARNING,
                                "Cannot dlsym dlsym (sic!)");