Fix crash with function declarations with unnamed parameters.

Fixes issue #103.
Previously, we were inadvertently grabbing the function's return type
  for the parameter, rather than the actual parameter type.
This commit is contained in:
Matt Pharr
2011-09-23 15:05:59 -07:00
parent 7126a39092
commit 5584240c7f
2 changed files with 2 additions and 1 deletions

View File

@@ -237,7 +237,7 @@ Declarator::GetType(DeclSpecs *ds) const {
sprintf(buf, "__anon_parameter_%d", i);
sym = new Symbol(buf, pos);
Declarator *declarator = new Declarator(sym, sym->pos);
sym->type = declarator->GetType(ds);
sym->type = declarator->GetType(d->declSpecs);
d->declarators.push_back(declarator);
}
else {