vhdlpp: Display an error message when calling a function with too many arguments.

This commit is contained in:
Maciej Suminski 2016-01-22 12:10:39 +01:00
parent 3b165a5f25
commit f2c8fb0479
1 changed files with 7 additions and 0 deletions

View File

@ -1118,6 +1118,13 @@ int elaborate_argument(Expression*expr, const SubprogramHeader*subp,
if(subp) {
const InterfacePort*param = subp->peek_param(idx);
if(!param) {
cerr << expr->get_fileline()
<< ": error: Too many arguments when calling "
<< subp->name() << "." << endl;
return 1;
}
// Enable reg_flag for variables that might be modified in subprograms
if(param->mode == PORT_OUT || param->mode == PORT_INOUT) {
if(const ExpName*e = dynamic_cast<const ExpName*>(expr)) {