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 95122ab..51dd733 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!)");