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:
Bill Currie 2012-12-18 13:52:02 +09:00
parent cd7c53d223
commit fe7cd7e7a7

View file

@ -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++;