dereference: fix handling DEREFERENCE from the database
commitcfe12a9b53fc66e89d42335ddb9b63db18392874
authorDan Carpenter <error27@gmail.com>
Sat, 11 Mar 2023 05:58:13 +0000 (11 08:58 +0300)
committerDan Carpenter <error27@gmail.com>
Sat, 11 Mar 2023 05:58:13 +0000 (11 08:58 +0300)
tree18d0a28c00bf09a8d4d91585d52838126ae77f93
parentd50c2ff1d0381ef94be80610ef86184b43145da1
dereference: fix handling DEREFERENCE from the database

The main problem is that we need to use the _early() hook.  Otherwise
smatch_extra.c processes this before us and marks the pointer as non-NULL.

The next problem is that the get_variable_from_key() generates a var/sym
and then we generate an expression back from that.  The problem is that
if we're dealing with complex things like arrays then that's not a var/sym
so it doesn't work.  We can instead go directly from and arg and a key to
an expression and that will work better.

Signed-off-by: Dan Carpenter <error27@gmail.com>
smatch_dereference.c