Oups! there was a bug when there was no xor in library

When trying to build it, recursion erased result of preceeding pattern matching.
Thanks to user which has discovered this bug
This commit is contained in:
Francois Donnet 2002-04-11 13:54:24 +00:00
parent a41f62ac2b
commit 698cc05087
1 changed files with 12 additions and 1 deletions

View File

@ -163,8 +163,15 @@ static void simpleCell(cell_list* cell)
static int addgeneric(chain_list *abl, befig_list* befig, int area, float R, float C, float T)
{
port_list* port;
port_list* top;
cell_list* cell;
if ( !abl )
{
fprintf(stderr,__FUNCTION__ ": NULL pointer\n");
exit(1);
}
if (ABL_ATOM(abl)) {
if (ABL_ATOM_VALUE(abl)!=getablatomone()
&& ABL_ATOM_VALUE(abl)!=getablatomzero()) {
@ -178,7 +185,9 @@ static int addgeneric(chain_list *abl, befig_list* befig, int area, float R, flo
/*cell->PORT contains the result of pattern matching*/
cell=cell_pattern(abl);
for (port=cell->PORT; port; port=port->NEXT) {
top=copyport(cell->PORT); /*not to be disturb by recursion*/
for (port=top; port; port=port->NEXT) {
if (isvss(port->NAME) || isvdd(port->NAME)) continue;
switch (port->DIRECTION) {
case OUT: case TRISTATE:
@ -190,6 +199,8 @@ static int addgeneric(chain_list *abl, befig_list* befig, int area, float R, flo
break;
}
}
delport(top);
return area+cell->AREA;
}