smatch_param_limit: extra: store parameter implications in return_states
commit7c6fe9d3bb7acc0e5b8fd8046017cf44988ed960
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 14 Dec 2012 13:17:40 +0000 (14 16:17 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Fri, 14 Dec 2012 13:17:40 +0000 (14 16:17 +0300)
tree502040f8606e7f224e073f9fc30cc05d43232d43
parent08179da07cb0356d6ccabfc4d70e98dafb7ec0af
smatch_param_limit: extra: store parameter implications in return_states

This is a re-implementation of the stuff in check_param_range.c.  The
problem with that was that it added another table to the database and it
conflicted with return_states.  Sometimes they would both settings and it
messed up the implications.  Param_range was also sort of complicated.
The new way is more powerful because it doesn't try to parse the code, it
just uses smatch_extra.c.

The problem with the new code is that it makes that database larger and it
is a slow down.  :(

The new code saves the values of the parameters down each path.  If we
modify the parameter, then it preserves the original value and uses that
instead.  At the end of the path it prints out the parameter value together
with the return value.

I also made the code check if the function has side effects.  I'm not
ready to use that code just yet but it may be useful later...  I should
hold off committing that but I am a bad and lazy person.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Makefile
check_list.h
smatch.h
smatch_extra.c
smatch_param_limit.c [new file with mode: 0644]
smatch_scripts/db/fill_db_no_side_effects.pl [new file with mode: 0755]
smatch_scripts/db/fill_db_return_states.pl
smatch_scripts/db/no_side_effects.schema [new file with mode: 0644]