From 541ba9db51a155c4eac929fac1db82aa728d17c9 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 18 Feb 2009 22:56:37 +0300 Subject: [PATCH] Call the merge_hook() instead of setting the state to &undefined. The reason for this is because check_null_deref wants the merged value for NULL and &assumed_nonnull to be &assumed_nonnull. Signed-off-by: Dan Carpenter --- smatch_slist.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/smatch_slist.c b/smatch_slist.c index 3c12ffe1..42317992 100644 --- a/smatch_slist.c +++ b/smatch_slist.c @@ -112,10 +112,12 @@ static void add_possible(struct sm_state *sm, struct sm_state *new) { struct sm_state *tmp; + if (!new) { - if (slist_has_state(sm->possible, &undefined)) - return; - tmp = alloc_state(sm->name, sm->owner, sm->sym, &undefined); + struct smatch_state *s; + + s = merge_states(sm->name, sm->owner, sm->sym, sm->state, NULL); + tmp = alloc_state(sm->name, sm->owner, sm->sym, s); add_sm_state_slist(&sm->possible, tmp); return; } -- 2.11.4.GIT