extra, function_hooks: fix handling of casted function calls
commit304f019c8ec9106a3783b5c0dbed2269d705b946
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 22 Feb 2013 07:42:20 +0000 (22 10:42 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Fri, 22 Feb 2013 07:42:20 +0000 (22 10:42 +0300)
treef214f2e84733e38e50b40c8020f28181f3a270a5
parentcb3c8e6d88b7f2289aaaf1626ad5dc5877cc235b
extra, function_hooks: fix handling of casted function calls

If we have code like this:
unsigned int frob();
...
int x = (unsigned char)frob();

There were several problems with this.  When we're changing the string
from the database "0-u32max" to a range_list then we need to do that with
a unsigned int type.  The current code was using unsigned char.  After we
have the unsigned int then we can cast it to unsigned char.

Also in smatch_extra.c it was looking at the cast operation and not
seeing that it was a function call.  It meant that we set the value then
set it again properly later.  It's doesn't cause a bug, but it's not
pretty.

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