function_hooks: fake parameter assignments
commitfd4b4db03c569f6c0bbdb7d950c9756a2c77c957
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 3 May 2021 15:18:02 +0000 (3 18:18 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Mon, 3 May 2021 15:18:02 +0000 (3 18:18 +0300)
tree49a7958c2560fb023a81b47342d36d78d0f29624
parentb16cb4cd87eb5689d15d399fe0333785066e273d
function_hooks: fake parameter assignments

This is to handle function which do something like:

int my_value(struct foo *p)
{
return p->value;
}

If the caller does: "x = my_value(p);" then we want that to create a fake
assignment "x = p->value;".  The trick is that a lot of code does stuff
like "foo = strip_expr(foo);" where "foo" is on both sides of the
assignment so we have to generate the fake assignment, store it, and then
parse it at the end.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_function_hooks.c