validate: check anonymous decl
[m6w6/ext-psi] / 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!)");