* Bug : when merging terminals, now uses the lowest index instead of

the latest. This avoid to be out of bound.
This commit is contained in:
Jean-Paul Chaput 2006-04-12 16:33:00 +00:00
parent 80f6732cea
commit ca05a0811f
3 changed files with 14 additions and 5 deletions

View File

@ -1,7 +1,7 @@
// -*- C++ -*-
//
// $Id: MNet.cpp,v 1.10 2005/10/13 12:44:39 jpc Exp $
// $Id: MNet.cpp,v 1.11 2006/04/12 16:33:00 jpc Exp $
//
// /----------------------------------------------------------------\
// | |
@ -488,6 +488,7 @@ void CNet::newaccess (string termName, CRect &rect, int z)
// Terminal not found : add a new one.
if (id == size) {
cerr << "Adding new terminal" << endl;
terms.push_back (new CTerm (termName, size));
size += 1;
}
@ -501,7 +502,13 @@ void CNet::newaccess (string termName, CRect &rect, int z)
}
catch (merge_term &e) {
mergeid = e.id;
if ( e.id > id ) {
mergeid = id;
id = e.id;
} else {
mergeid = e.id;
}
cerr << "Merging terminals : [" << id << "] absorbed by [" << mergeid << "]" << endl;
// Merge terminals ...
terms[mergeid]->merge (terms[id], mergeid, this);
@ -514,6 +521,7 @@ void CNet::newaccess (string termName, CRect &rect, int z)
// Re-computes the terminal's ids.
for (id = 0; id < size; id++) terms[id]->setid (id);
cerr << "New terminal max id " << id-1 << endl;
id = mergeid;
}

View File

@ -1,7 +1,7 @@
// -*- C++ -*-
//
// $Id: RMBK.cpp,v 1.15 2006/01/05 16:45:27 d2 Exp $
// $Id: RMBK.cpp,v 1.16 2006/04/12 16:33:00 jpc Exp $
//
// /----------------------------------------------------------------\
// | |
@ -484,6 +484,7 @@ void CRBox::mbkload (MBK::CFig *mbkfig
pIns = fig->instances[ins_name];
term_name = ins_name + "." + pLocon->NAME;
cdebug << "+ I.T : " << term_name << " " << pIns->model->NAME << ".\n";
// Find physical segments / CA of the terminal.
for (pSeg = pIns->model->PHSEG; pSeg != NULL; pSeg = pSeg->NEXT) {

View File

@ -1,7 +1,7 @@
// -*- C++ -*-
//
// $Id: nero.cpp,v 1.10 2005/10/17 23:11:06 jpc Exp $
// $Id: nero.cpp,v 1.11 2006/04/12 16:33:00 jpc Exp $
//
// /----------------------------------------------------------------\
// | |
@ -227,8 +227,8 @@ int main (int argc, char *argv[])
, global
, options["H"]->parsed
, options["R"]->parsed );
crbox->route ();
//cdebug.off ();
crbox->route ();
crbox->mbksave (name_routed);
}