Skip to content

Commit

Permalink
Found a crash condition reported by Abhinav Uppal where labels
Browse files Browse the repository at this point in the history
that are unattached (type = space) will cause magic to crash on
the command "lef write -hide"---The lowest level issue was in
SelectChunk(), so for good measure SelectChunk() now checks for
type == TT_SPACE, and "lef write" does also.
  • Loading branch information
RTimothyEdwards committed Sep 23, 2022
1 parent a550d61 commit f12a155
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lef/lefWrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -1442,8 +1442,10 @@ lefWriteMacro(def, f, scale, setback, pinonly, toplayer, domaster)
/* SelectDef. */

pNum = DBPlane(lab->lab_type);
DBPaintPlane(SelectDef->cd_planes[pNum], &carea,
DBStdPaintTbl(lab->lab_type, pNum), (PaintUndoInfo *) NULL);
if (pNum >= 0)
DBPaintPlane(SelectDef->cd_planes[pNum], &carea,
DBStdPaintTbl(lab->lab_type, pNum),
(PaintUndoInfo *) NULL);

/* Remember this area since it's going to get erased */
newlll = (labelLinkedList *)mallocMagic(sizeof(labelLinkedList));
Expand Down
3 changes: 3 additions & 0 deletions select/selCreate.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,9 @@ SelectChunk(scx, type, xMask, pArea, less)
SelSetDisplay(SelectUse, SelectRootDef);
}

/* Ignore if type is TT_SPACE */
if (type == TT_SPACE) return;

/* The chunk is computed iteratively. First extract a small
* region (defined by INITIALSIZE) into Select2Def. Then find
* the largest chunk in the region. If the chunk touches a
Expand Down

0 comments on commit f12a155

Please # to comment.