mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-24 11:12:21 +00:00
Catch omitted parameter names from function definitions.
void foo (int); is fine for a prototype (or, presumably, a qc function variable), but not for an actual function body. This fixes the segmentation fault when the parameter name is omitted.
This commit is contained in:
parent
cd7c53d223
commit
fe7cd7e7a7
1 changed files with 4 additions and 0 deletions
|
@ -466,6 +466,10 @@ build_scope (symbol_t *fsym, symtab_t *parent)
|
|||
continue; // ellipsis marker
|
||||
if (!p->type)
|
||||
continue; // non-param selector
|
||||
if (!p->name) {
|
||||
error (0, "parameter name omitted");
|
||||
p->name = save_string ("");
|
||||
}
|
||||
param = new_symbol_type (p->name, p->type);
|
||||
initialize_def (param, param->type, 0, symtab->space, sc_param);
|
||||
i++;
|
||||
|
|
Loading…
Reference in a new issue