Corrected a potential segfaulting error in which (apparently)
port labels that are unnattached ("attached" to space), or possibly
sticky labels without any geometry underneath, end up with a NULL
node during EFBuild().
This commit is contained in:
parent
e00a9a293f
commit
0598f4edf7
|
|
@ -155,23 +155,31 @@ efBuildNode(def, isSubsnode, nodeName, nodeCap, x, y, layerName, av, ac)
|
||||||
if (efWarn)
|
if (efWarn)
|
||||||
efReadError("Warning: duplicate node name %s\n", nodeName);
|
efReadError("Warning: duplicate node name %s\n", nodeName);
|
||||||
|
|
||||||
/* Just add to C, perim, area of existing node */
|
/* newnode should exist if newname does. Having a NULL node */
|
||||||
newnode = newname->efnn_node;
|
/* may be caused by detached labels "connected" to space. */
|
||||||
newnode->efnode_cap += (EFCapValue) nodeCap;
|
|
||||||
for (n = 0; n < efNumResistClasses && ac > 1; n++, ac -= 2)
|
if ((newnode = newname->efnn_node) != NULL)
|
||||||
{
|
{
|
||||||
newnode->efnode_pa[n].pa_area += atoi(*av++);
|
/* Just add to C, perim, area of existing node */
|
||||||
newnode->efnode_pa[n].pa_perim += atoi(*av++);
|
newnode->efnode_cap += (EFCapValue) nodeCap;
|
||||||
|
for (n = 0; n < efNumResistClasses && ac > 1; n++, ac -= 2)
|
||||||
|
{
|
||||||
|
newnode->efnode_pa[n].pa_area += atoi(*av++);
|
||||||
|
newnode->efnode_pa[n].pa_perim += atoi(*av++);
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate a new node with 'nodeName' as its single name */
|
if (!newname)
|
||||||
newname = (EFNodeName *) mallocMagic((unsigned)(sizeof (EFNodeName)));
|
{
|
||||||
newname->efnn_hier = EFStrToHN((HierName *) NULL, nodeName);
|
/* Allocate a new node with 'nodeName' as its single name */
|
||||||
newname->efnn_port = -1; /* No port assignment */
|
newname = (EFNodeName *) mallocMagic((unsigned)(sizeof (EFNodeName)));
|
||||||
newname->efnn_next = NULL;
|
newname->efnn_hier = EFStrToHN((HierName *) NULL, nodeName);
|
||||||
HashSetValue(he, (char *) newname);
|
newname->efnn_port = -1; /* No port assignment */
|
||||||
|
newname->efnn_next = NULL;
|
||||||
|
HashSetValue(he, (char *) newname);
|
||||||
|
}
|
||||||
|
|
||||||
/* New node itself */
|
/* New node itself */
|
||||||
size = sizeof (EFNode) + (efNumResistClasses - 1) * sizeof (EFPerimArea);
|
size = sizeof (EFNode) + (efNumResistClasses - 1) * sizeof (EFPerimArea);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue