From ac9f613401a6c15d78ba59723329b7a17ef57750 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 20 Jan 2017 15:22:23 +0300 Subject: [PATCH] db: use "extern" instead of the file name for globals in data_info The idea here is that we're storing all the possible values that we can have in a variable. Handle globals differently because it's not tied to the filename where they are modified. Signed-off-by: Dan Carpenter --- smatch_db.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/smatch_db.c b/smatch_db.c index cfa30342..28d2c3f8 100644 --- a/smatch_db.c +++ b/smatch_db.c @@ -258,7 +258,9 @@ void sql_insert_data_info(struct expression *data, int type, const char *value) data_name = get_data_info_name(data); if (!data_name) return; - sql_insert(data_info, "'%s', '%s', %d, '%s'", get_base_file(), data_name, type, value); + sql_insert(data_info, "'%s', '%s', %d, '%s'", + is_static(data) ? get_base_file() : "extern", + data_name, type, value); } char *get_static_filter(struct symbol *sym) -- 2.11.4.GIT