db: fix returned information
commit354c856f0a61b47a189a691a7e9475e530614d7a
authorDan Carpenter <error27@gmail.com>
Fri, 3 Mar 2023 11:23:56 +0000 (3 14:23 +0300)
committerDan Carpenter <error27@gmail.com>
Fri, 3 Mar 2023 11:23:56 +0000 (3 14:23 +0300)
treecac2668db4db92d721ac3528e4828dc08640ddfc
parent502d7d613704b7e469f71a14849dc4a3db1c725d
db: fix returned information

The second loop in print_return_struct_info() is supposed to handle the
situation where we do something like this:

void *frob(void *p)
{
return p;
}

The "p" pointer is both parameter 0 and the return.  The first loop is
supposed to handle that it's a parameter and the second loop is supposed
to handle that it's a return.  But instead the second loop says "it's a
parameter so don't print anything."

Fix this by creating a version of get_param_key_from_var_sym() that is
explicitly for returns.

Signed-off-by: Dan Carpenter <error27@gmail.com>
smatch.h
smatch_db.c
smatch_param_key.c