From 7d3cf14cdb2c500b65c1d709e5d91b6e8c689d57 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Thu, 27 Sep 2018 08:13:31 -0400 Subject: [PATCH] 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. --- extflat/EFbuild.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/extflat/EFbuild.c b/extflat/EFbuild.c index a5eeb411..1e9e5459 100644 --- a/extflat/EFbuild.c +++ b/extflat/EFbuild.c @@ -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)) { /*