Corrected a long-standing crash condition that happens when a

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.
This commit is contained in:
Tim Edwards 2024-11-26 13:43:27 -05:00
parent ea29aa3306
commit 8b34aa78a9
2 changed files with 25 additions and 2 deletions

View File

@ -1 +1 @@
8.3.501
8.3.502

View File

@ -224,7 +224,7 @@ DBCellDelete(cellname, force)
{
HashEntry *entry;
CellDef *celldef;
CellUse *celluse;
CellUse *celluse, *lastuse;
bool result;
entry = HashLookOnly(&dbCellDefTable, cellname);
@ -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! */