Skip to content

Commit

Permalink
Corrected a long-standing crash condition that happens when a
Browse files Browse the repository at this point in the history
generated cell is modified multiple times.  If the original cell
is orphaned (no longer used anywhere in the design), it is deleted.
However, an instance of the cell may exist in the secondary
select buffer if the cell was previously moved or copied, and
an attempt to do another move or copy will clear the secondary
select buffer, encounter the deleted cell, and crash the program.
  • Loading branch information
RTimothyEdwards committed Nov 26, 2024
1 parent ea29aa3 commit 8b34aa7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.3.501
8.3.502
25 changes: 24 additions & 1 deletion database/DBcellname.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ DBCellDelete(cellname, force)
{
HashEntry *entry;
CellDef *celldef;
CellUse *celluse;
CellUse *celluse, *lastuse;
bool result;

entry = HashLookOnly(&dbCellDefTable, cellname);
Expand Down Expand Up @@ -259,6 +259,29 @@ DBCellDelete(cellname, force)
return FALSE;
}

/* 2nd pass: If there are instances of the cell in */
/* internal cells like SelectDef, etc., then remove the use */
/* from the definition. */

lastuse = NULL;
celluse = celldef->cd_parents;
while (celluse != (CellUse *) NULL)
{
if (celluse->cu_parent != (CellDef *)NULL)
{
if ((celluse->cu_parent->cd_flags & CDINTERNAL) == CDINTERNAL)
{
DBDeleteCell(celluse);
celluse = lastuse;
}
}
lastuse = celluse;
if (lastuse == NULL)
celluse = celldef->cd_parents;
else
celluse = celluse->cu_nextuse;
}

/* Cleared to delete. . . now prompt user if the cell has changes. */
/* Last chance to save! */

Expand Down

0 comments on commit 8b34aa7

Please # to comment.