From 1d9526fce7496cc447e4ad6ed376d02385eb0cc5 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 27 Jul 2018 14:02:39 +0300 Subject: [PATCH] Revert "container_of: remove some duplicative code" This reverts commit 7d06b9e2b78f999f87030f87da676438316385fc. Doh... Smatch extra can't do that. It is required. Signed-off-by: Dan Carpenter --- smatch_container_of.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/smatch_container_of.c b/smatch_container_of.c index e4ab5f71..2643bca4 100644 --- a/smatch_container_of.c +++ b/smatch_container_of.c @@ -556,6 +556,14 @@ static struct stree *load_tag_info_sym(mtag_t tag, struct symbol *arg, int arg_o if (db_info.prev_offset != -1) set_param_value(&db_info.stree, arg, db_info.prev_offset, db_info.rl); + // FIXME: handle an offset correctly + if (!star && !arg_offset) { + sval_t sval; + + sval.type = get_real_base_type(arg); + sval.uvalue = tag; + set_state_stree(&db_info.stree, SMATCH_EXTRA, arg->ident->name, arg, alloc_estate_sval(sval)); + } return db_info.stree; } -- 2.11.4.GIT