extra: handle x = (u8)y; correctly
commit10fe85a486a5e587beb06165c0756fc8c035f44b
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 10 Jun 2015 10:44:18 +0000 (10 13:44 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 10 Jun 2015 10:44:18 +0000 (10 13:44 +0300)
tree532b4b997c9b531c64bafb98a929736a083c0666
parent1424fe558bd9262368d0266e355d2588320123f4
extra: handle x = (u8)y; correctly

If we do a truncate cast then that should be reflected when we handle
the assignment.  Currently we just strip the cast away.

When this was introduced, I said that I changed "how casts are handled" but
I think it is an "improvement".  Which is terribly vague and it's obviously
not correct to ignore casts...

Fixes: 1dcfc9fdad6d ('extra: shuffle match_assign a bit')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_extra.c
validation/sm_casts7.c [new file with mode: 0644]