fix: lef write crash (when cells with labels in space pNum==-1)

The issue here is can pNum==-1 which causes a crash.
This commit is contained in:
Darryl L. Miles 2024-06-04 15:07:43 +01:00 committed by Tim Edwards
parent 18a4dddc2b
commit 3638d382d6
1 changed files with 8 additions and 4 deletions

View File

@ -1591,8 +1591,10 @@ lefWriteMacro(def, f, scale, setback, pinonly, toplayer, domaster)
/* disappear by being inside the setback area. */
pNum = DBPlane(lab->lab_type);
DBPaintPlane(SelectDef->cd_planes[pNum], &labr,
DBStdPaintTbl(lab->lab_type, pNum), (PaintUndoInfo *) NULL);
if (pNum >= 0) // ignore labels in space
DBPaintPlane(SelectDef->cd_planes[pNum], &labr,
DBStdPaintTbl(lab->lab_type, pNum),
(PaintUndoInfo *) NULL);
}
else
{
@ -1607,8 +1609,10 @@ lefWriteMacro(def, f, scale, setback, pinonly, toplayer, domaster)
/* disappear by being inside the setback area. */
pNum = DBPlane(lab->lab_type);
DBPaintPlane(SelectDef->cd_planes[pNum], &labr,
DBStdPaintTbl(lab->lab_type, pNum), (PaintUndoInfo *) NULL);
if (pNum >= 0) // ignore labels in space
DBPaintPlane(SelectDef->cd_planes[pNum], &labr,
DBStdPaintTbl(lab->lab_type, pNum),
(PaintUndoInfo *) NULL);
}
}