extra/ranges: introduce is_noderef_ptr()
commitde60d9ea7bcf7bc658a808adc2133aaa6ddc48d1
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 6 Jan 2021 14:22:28 +0000 (6 17:22 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 6 Jan 2021 14:22:28 +0000 (6 17:22 +0300)
tree68b3532ebf01f3ef961dfd667feaf9df3a5efb60
parentb83725c4971003eceeaeb9009f3ef588edfe78df
extra/ranges: introduce is_noderef_ptr()

There are are a few kinds of pointer values which are never supposed to
be dereferenced such as NULL, error pointer and poison pointers like
0xDEADBEEF.

There are some subtleties in how to handle them.  Say we have:

foo->bar = 1;
foo = <something>

If "<something> is a normal pointer then "foo->bar" is unknown, but if it
is a noderef pointer then we can't talk about foo->bar in a meaningful
sense.

I'm not sure exactly how to handle these.  But the first step is to add a
function so we can identify them.  (In other words this patch is slightly
useless by itself).

The one thing this patch does do is that it marks 0xdead pointers as "gone"
in the sense of parent_is_gone().

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