Check for a possible corrupt function definition and return.
If a function definition has no ports and no return type it is assumed to be a bad definition so we don't check it further.
This commit is contained in:
parent
5aecd044c5
commit
f835c7569e
14
elab_sig.cc
14
elab_sig.cc
|
|
@ -589,9 +589,17 @@ void PFunction::elaborate_sig(Design*des, NetScope*scope) const
|
|||
break;
|
||||
|
||||
default:
|
||||
cerr << get_fileline() << ": internal error: I don't know how "
|
||||
<< "to deal with return type of function "
|
||||
<< scope->basename() << "." << endl;
|
||||
if (ports_) {
|
||||
cerr << get_fileline() << ": internal error: I don't know "
|
||||
<< "how to deal with return type of function "
|
||||
<< scope->basename() << "." << endl;
|
||||
} else {
|
||||
/* If we do not have any ports or a return type this
|
||||
* is probably a bad function definition. */
|
||||
cerr << get_fileline() << ": error: Bad definition for "
|
||||
<< "function " << scope->basename() << "?" << endl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
svector<NetNet*>ports (ports_? ports_->count() : 0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue