Corrected a problem with an uninitialized entry in ExtCurStyle that
could cause serious errors on systems that do not auto-zero allocated memory. Also: Fixed an error introduced by a recent commit to allocate character memory for efReadLine() which frees the memory before reading a .res.ext file, causing a crash when using "ext2spice" with the "extresist on" option.
This commit is contained in:
parent
ac244109bc
commit
fc9ecd2c9b
|
|
@ -1784,8 +1784,6 @@ findTile(tile, rtype)
|
|||
* purposes.
|
||||
*/
|
||||
|
||||
#define FLATTERMSIZE 1024
|
||||
|
||||
void
|
||||
FlatCopyAllLabels(scx, mask, xMask, targetUse)
|
||||
SearchContext *scx;
|
||||
|
|
|
|||
|
|
@ -661,9 +661,6 @@ dbcUnconnectFunc(tile, clientData)
|
|||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* To do: Make the tpath entries dynamically allocated */
|
||||
#define FLATTERMSIZE 1024
|
||||
|
||||
int
|
||||
dbcConnectLabelFunc(scx, lab, tpath, csa2)
|
||||
SearchContext *scx;
|
||||
|
|
@ -690,12 +687,16 @@ dbcConnectLabelFunc(scx, lab, tpath, csa2)
|
|||
|
||||
if (scx->scx_use != csa2->csa2_topscx->scx_use)
|
||||
{
|
||||
int newllen = tpath->tp_next - tpath->tp_first;
|
||||
newlabtext[0] = '\0';
|
||||
if (newllen > 0)
|
||||
strncpy(newlabtext, tpath->tp_first, newllen);
|
||||
sprintf(newlabtext + newllen, "%s", lab->lab_text);
|
||||
newlabptr = newlabtext;
|
||||
if (tpath)
|
||||
{
|
||||
int newllen = tpath->tp_next - tpath->tp_first;
|
||||
newlabtext[0] = '\0';
|
||||
if (newllen > 0)
|
||||
strncpy(newlabtext, tpath->tp_first, newllen);
|
||||
sprintf(newlabtext + newllen, "%s", lab->lab_text);
|
||||
newlabptr = newlabtext;
|
||||
}
|
||||
else return 0;
|
||||
}
|
||||
else
|
||||
newlabptr = lab->lab_text;
|
||||
|
|
|
|||
|
|
@ -651,6 +651,9 @@ typedef struct treeFilter
|
|||
#define TF_LABEL_ATTACH_NOT_SW 0x20 /* Same as above, ignore tile SW corner */
|
||||
#define TF_LABEL_ATTACH_CORNER 0x3C /* Mask of the four types above */
|
||||
|
||||
/* To do: Make the tpath entries dynamically allocated */
|
||||
#define FLATTERMSIZE 1024 /* Used for generating flattened labels */
|
||||
|
||||
/* -------------- Undo information passed to DBPaintPlane ------------- */
|
||||
|
||||
typedef struct
|
||||
|
|
|
|||
|
|
@ -606,7 +606,6 @@ resistChanged:
|
|||
}
|
||||
}
|
||||
(void) fclose(inf);
|
||||
if (line != NULL) freeMagic(line);
|
||||
|
||||
/* Is there an "extresist" extract file? */
|
||||
if (DoResist)
|
||||
|
|
@ -616,6 +615,7 @@ resistChanged:
|
|||
if (inf != NULL)
|
||||
goto readfile;
|
||||
}
|
||||
if (line != NULL) freeMagic(line);
|
||||
|
||||
/* If we are considering standard cells, only the first level of */
|
||||
/* subcircuits is meaningful. */
|
||||
|
|
|
|||
|
|
@ -810,8 +810,14 @@ ExtStyle *
|
|||
extTechStyleNew()
|
||||
{
|
||||
ExtStyle *style;
|
||||
TileType r;
|
||||
|
||||
style = extTechStyleAlloc();
|
||||
|
||||
/* This entry in ExtStyle is allocated and must be initialized */
|
||||
for (r = 0; r < NT; r++)
|
||||
style->exts_device[r] = NULL;
|
||||
|
||||
extTechStyleInit(style);
|
||||
return style;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,6 +103,8 @@ dbcConnectFuncDCS(tile, cx)
|
|||
int pNum;
|
||||
CellDef *def;
|
||||
ExtDevice *devptr;
|
||||
TerminalPath tpath;
|
||||
char pathstring[FLATTERMSIZE];
|
||||
|
||||
TiToRect(tile, &tileArea);
|
||||
srArea = &scx->scx_area;
|
||||
|
|
@ -113,8 +115,6 @@ dbcConnectFuncDCS(tile, cx)
|
|||
(tileArea.r_ytop <= srArea->r_ybot+1)))
|
||||
return 0;
|
||||
|
||||
|
||||
|
||||
t1 = TiGetType(tile);
|
||||
if TTMaskHasType(&DiffTypeBitMask,t1)
|
||||
{
|
||||
|
|
@ -264,7 +264,12 @@ dbcConnectFuncDCS(tile, cx)
|
|||
|
||||
scx2 = *csa2->csa2_topscx;
|
||||
scx2.scx_area = newarea;
|
||||
DBTreeSrLabels(&scx2, connectMask, csa2->csa2_xMask, NULL,
|
||||
|
||||
pathstring[0] = '\0';
|
||||
tpath.tp_first = tpath.tp_next = pathstring;
|
||||
tpath.tp_last = pathstring + FLATTERMSIZE;
|
||||
|
||||
DBTreeSrLabels(&scx2, connectMask, csa2->csa2_xMask, &tpath,
|
||||
TF_LABEL_ATTACH, dbcConnectLabelFunc,
|
||||
(ClientData)csa2);
|
||||
// DBCellCopyLabels(&scx2, connectMask, csa2->csa2_xMask, csa2->csa2_use, NULL);
|
||||
|
|
|
|||
Loading…
Reference in New Issue