diff --git a/elab_expr.cc b/elab_expr.cc index 2ed26fa03..dfa460306 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: elab_expr.cc,v 1.27 2000/08/26 01:31:29 steve Exp $" +#ident "$Id: elab_expr.cc,v 1.28 2000/09/24 17:41:13 steve Exp $" #endif @@ -164,7 +164,7 @@ NetExpr* PECallFunction::elaborate_expr(Design*des, NetScope*scope) const if (name_[0] == '$') return elaborate_sfunc_(des, scope); - NetFuncDef*def = des->find_function(scope->name(), name_); + NetFuncDef*def = des->find_function(scope, name_); if (def == 0) { cerr << get_line() << ": error: No function " << name_ << " in this context (" << scope->name() << ")." << endl; @@ -507,6 +507,9 @@ NetEUnary* PEUnary::elaborate_expr(Design*des, NetScope*scope) const /* * $Log: elab_expr.cc,v $ + * Revision 1.28 2000/09/24 17:41:13 steve + * fix null pointer when elaborating undefined task. + * * Revision 1.27 2000/08/26 01:31:29 steve * Handle out of range part select expressions. * diff --git a/elaborate.cc b/elaborate.cc index a5713302e..f85d213ef 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -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.190 2000/09/20 02:53:14 steve Exp $" +#ident "$Id: elaborate.cc,v 1.191 2000/09/24 17:41:13 steve Exp $" #endif /* @@ -1262,10 +1262,10 @@ NetProc* PCallTask::elaborate_usr(Design*des, const string&path) const NetScope*scope = des->find_scope(path); assert(scope); - NetTaskDef*def = des->find_task(path, name_); + NetTaskDef*def = des->find_task(scope, name_); if (def == 0) { cerr << get_line() << ": error: Enable of unknown task ``" << - path << "." << name_ << "''." << endl; + scope->name() << "." << name_ << "''." << endl; des->errors += 1; return 0; } @@ -2257,6 +2257,9 @@ Design* elaborate(const map&modules, /* * $Log: elaborate.cc,v $ + * Revision 1.191 2000/09/24 17:41:13 steve + * fix null pointer when elaborating undefined task. + * * Revision 1.190 2000/09/20 02:53:14 steve * Correctly measure comples l-values of assignments. * diff --git a/net_design.cc b/net_design.cc index a1a7443e5..92e6e6d1d 100644 --- a/net_design.cc +++ b/net_design.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: net_design.cc,v 1.15 2000/08/26 00:54:03 steve Exp $" +#ident "$Id: net_design.cc,v 1.16 2000/09/24 17:41:13 steve Exp $" #endif /* @@ -387,12 +387,11 @@ void Design::find_symbol(NetScope*scope, const string&name, } } -NetFuncDef* Design::find_function(const string&path, const string&name) +NetFuncDef* Design::find_function(NetScope*scope, const string&name) { - NetScope*scope = find_scope(path); assert(scope); NetScope*func = find_scope(scope, name); - if (func->type() == NetScope::FUNC) + if (func && (func->type() == NetScope::FUNC)) return func->func_def(); return 0; @@ -407,12 +406,10 @@ NetFuncDef* Design::find_function(const string&key) return 0; } -NetTaskDef* Design::find_task(const string&path, const string&name) +NetTaskDef* Design::find_task(NetScope*scope, const string&name) { - NetScope*scope = find_scope(path); - assert(scope); NetScope*task = find_scope(scope, name); - if (task->type() == NetScope::TASK) + if (task && (task->type() == NetScope::TASK)) return task->task_def(); return 0; @@ -489,6 +486,9 @@ void Design::delete_process(NetProcTop*top) /* * $Log: net_design.cc,v $ + * Revision 1.16 2000/09/24 17:41:13 steve + * fix null pointer when elaborating undefined task. + * * Revision 1.15 2000/08/26 00:54:03 steve * Get at gate information for ivl_target interface. * diff --git a/netlist.h b/netlist.h index 2abbad7fb..a48abbf2b 100644 --- a/netlist.h +++ b/netlist.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: netlist.h,v 1.165 2000/09/24 15:44:44 steve Exp $" +#ident "$Id: netlist.h,v 1.166 2000/09/24 17:41:13 steve Exp $" #endif /* @@ -2709,11 +2709,11 @@ class Design { NetNet*&sig, NetMemory*&mem); // Functions - NetFuncDef* find_function(const string&path, const string&key); + NetFuncDef* find_function(NetScope*scope, const string&key); NetFuncDef* find_function(const string&path); // Tasks - NetTaskDef* find_task(const string&path, const string&name); + NetTaskDef* find_task(NetScope*scope, const string&name); NetTaskDef* find_task(const string&key); // NODES @@ -2799,6 +2799,9 @@ extern ostream& operator << (ostream&, NetNet::Type); /* * $Log: netlist.h,v $ + * Revision 1.166 2000/09/24 17:41:13 steve + * fix null pointer when elaborating undefined task. + * * Revision 1.165 2000/09/24 15:44:44 steve * Move some NetNet method out of the header file. *