Modification to prevent crashing on an attempt to do an area erase on

a read-only layout.
This commit is contained in:
Tim Edwards 2021-12-07 14:25:50 -05:00
parent 9f7011333a
commit 552d6de0f7
3 changed files with 16 additions and 4 deletions

View File

@ -1 +1 @@
8.3.238
8.3.239

View File

@ -869,6 +869,7 @@ CmdPaintEraseButton(w, butPoint, isPaint)
TTMaskClearType(&mask, TT_SPACE);
if (!ToolGetEditBox(&editRect)) return;
if (EditRootDef == (CellDef *)NULL) return;
areaReturn = editRect;
if (TTMaskEqual(&mask, &DBZeroTypeBits))

View File

@ -949,7 +949,8 @@ defNetGeometryFunc(tile, plane, defdata)
if ((h != routeWidth) && (w != routeWidth))
{
/* Diagnostic */
TxPrintf("Net has width %d, default width is %d\n",
TxPrintf("Net at (%d, %d) has width %d, default width is %d\n",
r.r_xbot, r.r_ybot,
(h < w) ? h : w, routeWidth);
}
@ -1666,7 +1667,12 @@ defWriteVias(f, rootDef, oscale, lefMagicToLefLayer)
if (nAc == 0)
{
left = (r->r_xbot + r->r_xtop - size) / 2;
if (left >= r->r_xbot) nAc = 1;
nAc = 1;
if (left < r->r_xbot)
{
TxError("Warning: via size is %d but area width is %d!\n",
size, (r->r_xtop - r->r_xbot));
}
}
else
left = (r->r_xbot + r->r_xtop + sep - (nAc * pitch)) / 2;
@ -1675,7 +1681,12 @@ defWriteVias(f, rootDef, oscale, lefMagicToLefLayer)
if (nUp == 0)
{
square.r_ybot = (r->r_ybot + r->r_ytop - size) / 2;
if (square.r_ybot >= r->r_ybot) nUp = 1;
nUp = 1;
if (square.r_ybot >= r->r_ybot)
{
TxError("Warning: via size is %d but area height is %d!\n",
size, (r->r_ytop - r->r_ybot));
}
}
else
square.r_ybot = (r->r_ybot + r->r_ytop + sep - (nUp * pitch)) / 2;