extra: introduce value_ptr_rl
commit323135b27b2ed0962031b829743dc1c5dfcf0ee1
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 24 Jul 2018 12:29:08 +0000 (24 15:29 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Tue, 24 Jul 2018 12:29:08 +0000 (24 15:29 +0300)
tree90620965bf436342d32ff311df3b7018e81c406e
parent48a04a4d9097b9d70831b8ac2d1196c5cdae4194
extra: introduce value_ptr_rl

There is a lot of talking about min-max pointer but actually right now
pointers are kind of treated as signed.  There are two reasons for that.
1) Pointers are not marked as MOD_UNSIGNED and even when I mark them
as MOD_UNSIGNED, smatch still treats them as signed for some reason.  Also
SYM_ARRAY are explicitly set to match.  This isn't the right thing really
because pointers should be treated as unsigned normally.
2) But I haven't investigated because the kernel uses error pointers and
it's really handy to think of them as -12 instead of whatever that looks
like when you cast it to unsigned.

So anyway, say you have a non-NULL pointer which is (in the current code)
"s64min-(-1),1-s64max", then it doesn't make sense to talk about if it's
min-max because the max would be -1UL.

I want to eventually figure out a better way to handle pointers...

This code is a cleanup, but eventually maybe instead of talking about
min-max we'll just talk about the range list?

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