From e7786241cdaf43279f6e2acb7b443540074830da Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 4 May 2017 14:13:46 +0300 Subject: [PATCH] modification_hooks: use long to short mappings In smatch_extra we use these long to short mappings to parse returned states. We should use them in smatch_modification_hooks.c as well. Signed-off-by: Dan Carpenter --- smatch_modification_hooks.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/smatch_modification_hooks.c b/smatch_modification_hooks.c index b4d2a5b2..838ae97f 100644 --- a/smatch_modification_hooks.c +++ b/smatch_modification_hooks.c @@ -145,8 +145,8 @@ free: static void db_param_add(struct expression *expr, int param, char *key, char *value) { struct expression *arg; - char *name; - struct symbol *sym; + char *name, *other_name; + struct symbol *sym, *other_sym; while (expr->type == EXPR_ASSIGNMENT) expr = strip_expr(expr->right); @@ -162,6 +162,13 @@ static void db_param_add(struct expression *expr, int param, char *key, char *va goto free; call_modification_hooks_name_sym(name, sym, expr, BOTH); + + other_name = map_long_to_short_name_sym(name, sym, &other_sym); + if (other_name) { + call_modification_hooks_name_sym(other_name, other_sym, expr, BOTH); + free_string(other_name); + } + free: free_string(name); } -- 2.11.4.GIT