db: change the file searched for static functions
commitf750e4993c4ffd931e89c9cb58eac805f68e5b51
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 14 Mar 2013 12:46:46 +0000 (14 15:46 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 14 Mar 2013 12:46:46 +0000 (14 15:46 +0300)
tree39090975d96b70890cd9d39c5ade935c0f8c7d86
parent5b48940e4c18f1ecc53e33d3e0c4cb2da6ad1618
db: change the file searched for static functions

The deal is that say you are parsing foo.c and you call a static function
my_function(), then you would expect that function to be found in foo.c
as well.  But actually it could from an included filed.

In this situation get_filename() returns the name of the included file
and get_base_file() returns "foo.c".  We want to use get_base_file
throughout.

This description is not totally correct.  get_filename() returns the
base file if you pass the --info flag so the information in the database
is already what we want.  To hit this bug you would have to call an
included function from a second included function.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch.h
smatch_db.c
smatch_flow.c