diff --git a/net_scope.cc b/net_scope.cc index 4ef9b653b..225a8b26e 100644 --- a/net_scope.cc +++ b/net_scope.cc @@ -119,7 +119,6 @@ NetScope::NetScope(NetScope*up, const hname_t&n, NetScope::TYPE t, NetScope*in_u is_interface_(interface), is_unit_(compilation_unit), unit_(in_unit), up_(up) { imports_ = 0; - typedefs_ = 0; events_ = 0; lcounter_ = 0; is_auto_ = false; @@ -244,7 +243,7 @@ NetScope*NetScope::find_import(const Design*des, perm_string name) void NetScope::add_typedefs(const map*typedefs) { if (!typedefs->empty()) - typedefs_ = typedefs; + typedefs_ = *typedefs; } NetScope*NetScope::find_typedef_scope(const Design*des, data_type_t*type) @@ -253,7 +252,7 @@ NetScope*NetScope::find_typedef_scope(const Design*des, data_type_t*type) NetScope *cur_scope = this; while (cur_scope) { - if (cur_scope->typedefs_ && cur_scope->typedefs_->find(type->name) != cur_scope->typedefs_->end()) + if (cur_scope->typedefs_.find(type->name) != cur_scope->typedefs_.end()) return cur_scope; NetScope*import_scope = cur_scope->find_import(des, type->name); if (import_scope) @@ -821,6 +820,8 @@ bool NetScope::symbol_exists(perm_string sym) return true; if (classes_.find(sym) != classes_.end()) return true; + if (typedefs_.find(sym) != typedefs_.end()) + return true; return false; } diff --git a/netlist.h b/netlist.h index 5f554df9a..e1d70bfcb 100644 --- a/netlist.h +++ b/netlist.h @@ -1281,7 +1281,7 @@ class NetScope : public Definitions, public Attrib { const map*imports_; - const map*typedefs_; + maptypedefs_; NetEvent *events_;