Oops, Sept. 25 commit introduced an error that causes exactly what

the patch was attempting to fix.  For node naming, ports were given
precedence over globals.  However, this failed to distinguish between
ports on the top level and ports down in the hierarchy.  This has now
been fixed.  Ports on the hierarchy top level have naming precedence
over everything else;  otherwise, the traditional rules of node
naming precedence apply.
This commit is contained in:
Tim Edwards 2018-09-27 08:13:31 -04:00
parent 7189d84a08
commit 7d3cf14cdb
1 changed files with 13 additions and 3 deletions

View File

@ -1442,6 +1442,7 @@ efNodeAddName(node, he, hn)
{
EFNodeName *newnn;
EFNodeName *oldnn;
bool topport;
newnn = (EFNodeName *) mallocMagic((unsigned)(sizeof (EFNodeName)));
newnn->efnn_node = node;
@ -1449,10 +1450,13 @@ efNodeAddName(node, he, hn)
newnn->efnn_port = -1;
HashSetValue(he, (char *) newnn);
topport = ((node->efnode_flags & EF_PORT) &&
(node->efnode_name->efnn_hier->hn_parent == NULL)) ?
TRUE : FALSE;
/* Link in the new name */
oldnn = node->efnode_name;
if (oldnn == NULL || EFHNBest(newnn->efnn_hier, oldnn->efnn_hier)
|| (node->efnode_flags & EF_PORT))
if (oldnn == NULL || EFHNBest(newnn->efnn_hier, oldnn->efnn_hier) || topport)
{
/* New head of list */
newnn->efnn_next = oldnn;
@ -1528,14 +1532,20 @@ efNodeMerge(node1, node2)
/* Make all EFNodeNames point to node1 */
if (node2->efnode_name)
{
bool topport;
for (nn = node2->efnode_name; nn; nn = nn->efnn_next)
{
nnlast = nn;
nn->efnn_node = node1;
}
topport = ((node2->efnode_flags & EF_PORT) &&
(node2->efnode_name->efnn_hier->hn_parent == NULL)) ?
TRUE : FALSE;
/* Concatenate list of EFNodeNames, taking into account precedence */
if ((node2->efnode_flags & EF_PORT) || EFHNBest(node2->efnode_name->efnn_hier,
if (topport || EFHNBest(node2->efnode_name->efnn_hier,
node1->efnode_name->efnn_hier))
{
/*