core: improve is_array() and get_array_base()
commit034f0de11b63b676186693a45550bd47854344fa
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 17 Dec 2014 12:32:57 +0000 (17 15:32 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 17 Dec 2014 12:32:57 +0000 (17 15:32 +0300)
treed58328603ce4f9ab12c3e70a3122a958f20c43b4
parentaf21d39cbfff0bcce706f3ea9f2e39af50f99f28
core: improve is_array() and get_array_base()

If you have an array full of function pointers then Smatch is supposed to
record that, but it wasn't working because is_array() almost always
returned false.

I've improved is_array().  But now it returns true for EXPR_BINOP as well
as EXPR_PREOP so a bunch of the callers had to be updated.  They assumed
that only EXPR_PREOP was an array and we should use expr->unop->left to
get the array and expr->unop->right to get the offset.  This is quite
bogus.

We have a function to give the array and the array offset.  I've renamed
the "get array" function from get_array_name() to get_array_base().  That
name sort of sucks as well...  I can rename it later with sed so that's
ok.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
check_buf_comparison.c
check_check_deref.c
check_deref.c
check_overflow.c
smatch.h
smatch_buf_size.c
smatch_extra.c
smatch_function_ptrs.c
smatch_helper.c
smatch_param_cleared.c