vhdlpp: Fixed crash on unassociated generics.

This commit is contained in:
Maciej Suminski 2015-03-06 19:30:02 +01:00
parent 807ad8002d
commit 295e4e7dfb
2 changed files with 7 additions and 4 deletions

View File

@ -92,6 +92,7 @@ int Entity::elaborate_generic_exprs_()
for (vector<InterfacePort*>::const_iterator cur = parms_.begin()
; cur != parms_.end() ; ++cur) {
InterfacePort*curp = *cur;
if(curp->expr)
curp->expr->elaborate_expr(this, 0, curp->type);
}
return errors;

View File

@ -50,10 +50,12 @@ int Entity::emit(ostream&out)
const InterfacePort*curp = *cur;
if (cur != parms_.begin())
out << ", ";
out << "parameter \\" << curp->name << " = ";
ivl_assert(*this, curp->expr);
out << "parameter \\" << curp->name << " ";
if(curp->expr) {
out << "= ";
errors += curp->expr->emit(out, this, 0);
}
}
out << ") ";
}