Added checks to prevent magic from crashing when running various

commands on selections in a cell that is not editable.  Moves
and Copies were already handled correctly;  this correction fixes
Delete and transforms (e.g., rotates and flips).
This commit is contained in:
Tim Edwards 2021-10-28 15:57:17 -04:00
parent 4d6ef8e252
commit c82c96cb73
4 changed files with 17 additions and 1 deletions

View File

@ -1 +1 @@
8.3.220
8.3.221

View File

@ -695,6 +695,9 @@ defnodeVisit(node, res, cap, defdata)
TTMaskZero(&tmask);
TTMaskSetMask(&tmask, &DBConnectTbl[magictype]);
/* Avoid attempting to extract an implicit substrate into DEF */
if (node->efnode_type == TT_SPACE) return 0;
DBSrConnect(def, &node->efnode_loc, &tmask, DBConnectTbl,
&TiPlaneRect, defNetGeometryFunc,
(ClientData)defdata);

View File

@ -149,6 +149,9 @@ SelEnumPaint(layers, editOnly, foundNonEdit, func, clientData)
arg.sea_rectList = NULL;
if (foundNonEdit != NULL) *foundNonEdit = FALSE;
/* EditCellUse is referenced in selEnumPFunc1() and must be non-NULL */
if (EditCellUse == NULL) return 1;
/* First, find all the paint in the selection that has the right
* layers. Use the same procedure as "dbCellUniqueTileSrFunc()"
* so that contacts are not double-counted.

View File

@ -103,6 +103,11 @@ SelectDelete(msg, do_clear)
extern int selDelPaintFunc(), selDelCellFunc(), selDelLabelFunc();
if (EditCellUse == NULL)
{
TxError("The current cell is not editable.\n");
return;
}
(void) SelEnumPaint(&DBAllButSpaceAndDRCBits, TRUE, &nonEdit,
selDelPaintFunc, (ClientData) NULL);
if (nonEdit)
@ -964,6 +969,11 @@ SelectTransform(transform)
* visible) coordinates.
*/
{
if (EditCellUse == NULL)
{
TxError("The current cell is not editable.\n");
return;
}
/* Copy from SelectDef to Select2Def, transforming along the way. */