[PATCH 3/4] dissect: change deanon() to handle the !node case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Change deanon() to always initialize base->ident when parent != NULL
but still return false to avoid the pointless ->r_symdef().

Test-case:

	struct {
		union {
			int x;
		};
	} var = {
		{ .x = 0 },
	};

before this patch:

	1:8   s def  :var
	5:3   g def  var                              struct :var
	5:3   g -w-  var                              struct :var
	6:12  s -w-  ?.x                              int

after:

	1:8   s def  :var
	5:3   g def  var                              struct :var
	5:3   g -w-  var                              struct :var
	6:12  s -w-  :var.x                           int

Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
---
 dissect.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dissect.c b/dissect.c
index d34b38a..57dcdb2 100644
--- a/dissect.c
+++ b/dissect.c
@@ -195,8 +195,10 @@ static bool deanon(struct symbol *base, struct ident *node, struct symbol *paren
 	struct ident *pi = parent ? parent->ident : NULL;
 	char name[256];
 
-	if (!node)
+	if (!node) {
+		base->ident = pi;
 		return false;
+	}
 
 	snprintf(name, sizeof(name), "%.*s:%.*s",
 		pi ? pi->len : 0, pi ? pi->name : NULL, node->len, node->name);
-- 
2.5.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux