From 21e51db5f9ad2594eaf983954dad8fad36312cc5 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 29 Jan 2014 01:51:13 +0300 Subject: [PATCH] function_ptrs: ignore duplicate information This is when we are copying a struct member to itself. Obviously it's equal. No need to record that in the database. Signed-off-by: Dan Carpenter --- smatch_function_ptrs.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/smatch_function_ptrs.c b/smatch_function_ptrs.c index 9173f721..93bc6327 100644 --- a/smatch_function_ptrs.c +++ b/smatch_function_ptrs.c @@ -166,6 +166,9 @@ static void match_function_assign(struct expression *expr) char *fn_name; char *ptr_name; + if (__in_fake_assign) + return; + right = strip_expr(expr->right); if (right->type == EXPR_PREOP && right->op == '&') right = strip_expr(right->unop); @@ -188,6 +191,8 @@ static void match_function_assign(struct expression *expr) ptr_name = get_fnptr_name(expr->left); if (!fn_name || !ptr_name) goto free; + if (strcmp(fn_name, ptr_name) == 0) + goto free; sql_insert_function_ptr(fn_name, ptr_name); -- 2.11.4.GIT