From 93b13e3244a5b7dda97a4d51d321ca5eb6dcb85b Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 8 May 2017 11:50:46 +0300 Subject: [PATCH] user_data2: if users can only specify a single value that's not a user rl It's often the case where we pass a user rl through a switch statement or something. I feel like any time we limit a user rl to a single value that we should just ignore it. We're saving too much stuff in the database. Signed-off-by: Dan Carpenter --- check_user_data2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/check_user_data2.c b/check_user_data2.c index f4509dbe..2c897bfe 100644 --- a/check_user_data2.c +++ b/check_user_data2.c @@ -79,6 +79,7 @@ static void pre_merge_hook(struct sm_state *sm) struct smatch_state *user; struct smatch_state *extra; struct range_list *rl; + sval_t dummy; extra = get_state(SMATCH_EXTRA, sm->name, sm->sym); if (!extra || !estate_rl(extra)) @@ -87,6 +88,8 @@ static void pre_merge_hook(struct sm_state *sm) if (!user || !estate_rl(user)) return; rl = rl_intersection(estate_rl(user), estate_rl(extra)); + if (rl_to_sval(rl, &dummy)) + rl = NULL; set_state(my_id, sm->name, sm->sym, alloc_estate_rl(clone_rl(rl))); } -- 2.11.4.GIT