struct_assignment: don't double parse ulong assignments
commitf86bfd7f4a5304d1b1ebfc5d7f1540dce18d5414
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 6 Dec 2017 11:12:00 +0000 (6 14:12 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 6 Dec 2017 11:12:00 +0000 (6 14:12 +0300)
tree5f2a32f8c016cd52fc461fc214dea589732d9024
parent6bf6a6f2bc4334079581ff8c249cf35a01af12ab
struct_assignment: don't double parse ulong assignments

The bug is that when have code like;

ulong_var = foo;

It creates one fake assignment so what it parses looks like this:

ulong_var = foo;
ulong_var = foo;

The struct_assiment code is supposed to fake SYM_BASETYPE assignments
for memcpy() otherwise there is no need to fake anything for regular
assignments.

This code works for struct assignments because we want to fake an
assignment for each struct member, and for pointers assignments like
"p = my_ptr;" we want to fake an assignment for "*p = *my_ptr".  If
we can't determine the type of expr->left then don't fake anything.

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