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:
parent
ea29aa3306
commit
8b34aa78a9
|
|
@ -224,7 +224,7 @@ DBCellDelete(cellname, force)
|
||||||
{
|
{
|
||||||
HashEntry *entry;
|
HashEntry *entry;
|
||||||
CellDef *celldef;
|
CellDef *celldef;
|
||||||
CellUse *celluse;
|
CellUse *celluse, *lastuse;
|
||||||
bool result;
|
bool result;
|
||||||
|
|
||||||
entry = HashLookOnly(&dbCellDefTable, cellname);
|
entry = HashLookOnly(&dbCellDefTable, cellname);
|
||||||
|
|
@ -259,6 +259,29 @@ DBCellDelete(cellname, force)
|
||||||
return FALSE;
|
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. */
|
/* Cleared to delete. . . now prompt user if the cell has changes. */
|
||||||
/* Last chance to save! */
|
/* Last chance to save! */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue