extra: filter really long unused param value information
commitbc5f5a07e112f2cc2b006de03a9ad4d36b3acd6b
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 22 Jan 2019 19:46:42 +0000 (22 22:46 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Tue, 22 Jan 2019 19:46:42 +0000 (22 22:46 +0300)
tree5dae2fb79a32d893b1fcb6a0604d9a06b0bdc110
parent97467d1d0690292ba250aa5296168249efa47a25
extra: filter really long unused param value information

One of the challenges with the cross function DB is knowing what
information is useful.  We have the PARAM_USED feature, but that
information takes a while to propagate back up the call tree so it's not
entirely trust worthy.

Before I just said that if we are passing foo->bar and we know it's zero
and we don't think it's used then don't record that information.  But now
I have also added a heuristic that really long things like foo->bar->baz,
but even slightly longer than that should not be passed.

This has two effects, first it makes the DB smaller and it's a runtime
speed up (I have not benchmarked this).  Secondly, it means that we have
fewer states at the start of the function and this means that we have
fewer states when we return and it changes how returns are handled and
perhaps makes things more accurate.

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