diff --git a/PScope.cc b/PScope.cc index 9fb4cef55..377142bf9 100644 --- a/PScope.cc +++ b/PScope.cc @@ -31,6 +31,9 @@ PScope::PScope(perm_string n) PScope::~PScope() { + for(map::iterator it = typedefs.begin(); + it != typedefs.end(); ++it) + delete it->second; } PWire* LexicalScope::wires_find(perm_string name) diff --git a/main.cc b/main.cc index 5c7e040a1..3658ba512 100644 --- a/main.cc +++ b/main.cc @@ -1142,6 +1142,12 @@ int main(int argc, char*argv[]) (*idx).second = 0; } + for(map::iterator it = pform_typedefs.begin() + ; it != pform_typedefs.end() ; ++it) { + delete (*it).second; + (*it).second = 0; + } + if (verbose_flag) { if (times_flag) { times(cycles+2); diff --git a/pform.cc b/pform.cc index 7c58fa343..68e9a072d 100644 --- a/pform.cc +++ b/pform.cc @@ -1885,7 +1885,6 @@ static void pform_set_net_range(list*names, } delete names; - delete range; } /* diff --git a/vhdlpp/vtype_emit.cc b/vhdlpp/vtype_emit.cc index f932cb8e1..a723dbda5 100644 --- a/vhdlpp/vtype_emit.cc +++ b/vhdlpp/vtype_emit.cc @@ -219,7 +219,14 @@ int VTypeDef::emit_decl(ostream&out, perm_string name, bool reg_flag) const else out << "wire "; - errors += type_->emit_def(out, name); + if(dynamic_cast(type_)) { + errors += type_->emit_def(out, name); + } else { + assert(name_ != empty_perm_string); + cout << "\\" << name_; + emit_name(out, name); + } + return errors; }