From 0eafe88f6a4decbc8233c16c8114fb6e35b2a4f7 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 2 Jun 2016 17:27:49 +0300 Subject: [PATCH] extra: export get_other_name_sym() This is kind of a handy function when you are building the DB. This is already built into the smatch_param_*.c files because they use smatch extra modification hooks. But for check_locking sometimes people do lock(param->foo->bar->lock) followed by an unlock(bar->lock);. It looks different but it's the same variable. Signed-off-by: Dan Carpenter --- smatch.h | 2 ++ smatch_extra.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/smatch.h b/smatch.h index 2c077067..5009a836 100644 --- a/smatch.h +++ b/smatch.h @@ -531,6 +531,8 @@ static const sval_t vmalloc_seg_max = { {.value = 677777777}, }; +char *get_other_name_sym(const char *name, struct symbol *sym, struct symbol **new_sym); + #define STRLEN_MAX_RET 1010101 /* smatch_absolute.c */ diff --git a/smatch_extra.c b/smatch_extra.c index 4d3cdef3..638fa0f4 100644 --- a/smatch_extra.c +++ b/smatch_extra.c @@ -88,7 +88,7 @@ struct sm_state *set_extra_mod_helper(const char *name, struct symbol *sym, stru return set_state(SMATCH_EXTRA, name, sym, state); } -static char *get_other_name_sym(const char *name, struct symbol *sym, struct symbol **new_sym) +char *get_other_name_sym(const char *name, struct symbol *sym, struct symbol **new_sym) { struct expression *assigned; char *orig_name = NULL; -- 2.11.4.GIT