extra, function_hooks, db: change cross function analysis for returns
commitd6a208c11ba6335de39db6bc20ec86d7d425be07
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 14 Aug 2012 08:34:43 +0000 (14 11:34 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Tue, 14 Aug 2012 08:34:43 +0000 (14 11:34 +0300)
treed513fe521d6ab7ccdf6c455208551ffeedda2268
parentaccfed28f5d0463a187e59d56bf025c466ce7582
extra, function_hooks, db: change cross function analysis for returns

Before we looked up the return value in return_values and used that to
set the variable in smatch_extra.

What we want ideally is for each return to be an slist.  We merge the
slists together to give the current slist after the function call.  This
would preserve implications.  This patch is a step in that direction.

So basically we store all the information listed in the last paragraph in
the return_states table.  We merge it together.  Done.

The complication is that the return_implies_hook functions do the same
thing and they have to have precedence.  Also the
add_function_assign_hook_extra() conflicts if we use it to set a state
in smatch extra.  And a final conflict is that there is a return_implies
table which does something similar.  This table should be removed
eventually.

I am not ready to push any checks which use the return_states table yet.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
check_kernel.c
check_return_efault.c
smatch.h
smatch_extra.c
smatch_function_hooks.c