diff mbox

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

Message ID 20170311154725.87906-2-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Luc Van Oostenryck March 11, 2017, 3:47 p.m. UTC
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@gmail.com>
---
 flow.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Christopher Li April 27, 2017, 10:41 p.m. UTC | #1
On Sat, Mar 11, 2017 at 10:47 AM, Luc Van Oostenryck
<luc.vanoostenryck@gmail.com> wrote:
> 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.


Looks good to me.

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

Patch

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;
 }