[PATCH v0 1/4] be more careful with concat_user_list()

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

 



In convert_instruction_target(), once all users have been converted
the old user list is concatened to the one of the replacing pseudo.
But this pseudo may be one for which a user list is meaningless,
like PSEUDO_VAL.

While as such it's not a problem, it inhibit the reuse of the users
pointer for other uses.

Fix this by doing the concatenation only if the pseudo can have
an use-list.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 flow.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/flow.c b/flow.c
index 8111e1ae6..6878c0b4c 100644
--- a/flow.c
+++ b/flow.c
@@ -254,7 +254,8 @@ void convert_instruction_target(struct instruction *insn, pseudo_t src)
 			*pu->userp = src;
 		}
 	} END_FOR_EACH_PTR(pu);
-	concat_user_list(target->users, &src->users);
+	if (has_use_list(src))
+		concat_user_list(target->users, &src->users);
 	target->users = NULL;
 }
 
-- 
2.11.1

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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