Permalink
Browse files

Detect a missing task definition before it crashes me.

  • Loading branch information...
1 parent 8654412 commit e17f7f514647e3f012863a4c9e3deb7d2a90b700 steve committed Jul 28, 2001
Showing with 10 additions and 5 deletions.
  1. +10 −5 elaborate.cc
View
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: elaborate.cc,v 1.217 2001/07/25 03:10:49 steve Exp $"
+#ident "$Id: elaborate.cc,v 1.218 2001/07/28 22:13:11 steve Exp $"
#endif
# include "config.h"
@@ -1340,14 +1340,16 @@ NetProc* PCallTask::elaborate_usr(Design*des, const string&path) const
assert(scope);
NetScope*task = des->find_task(scope, name_);
- NetTaskDef*def = task->task_def();
- if (def == 0) {
- cerr << get_line() << ": error: Enable of unknown task ``" <<
- scope->name() << "." << name_ << "''." << endl;
+ if (task == 0) {
+ cerr << get_line() << ": error: Enable of unknown task "
+ << "``" << name_ << "''." << endl;
des->errors += 1;
return 0;
}
+ assert(task);
+ NetTaskDef*def = task->task_def();
+
if (nparms() != def->port_count()) {
cerr << get_line() << ": error: Port count mismatch in call to ``"
<< name_ << "''." << endl;
@@ -2343,6 +2345,9 @@ Design* elaborate(const map<string,Module*>&modules,
/*
* $Log: elaborate.cc,v $
+ * Revision 1.218 2001/07/28 22:13:11 steve
+ * Detect a missing task definition before it crashes me.
+ *
* Revision 1.217 2001/07/25 03:10:49 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)

0 comments on commit e17f7f5

Please sign in to comment.