struct_assignment: handle memcpy(foo, ...) where foo is not a struct
commitdb73713e1d803452796d7e4365a4c836b4196587
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 29 May 2014 12:05:57 +0000 (29 15:05 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 29 May 2014 12:05:57 +0000 (29 15:05 +0300)
tree96f5628beb676b4a093bd28df016bc2e4663b116
parent9a2009df403641c8d16d12ee0fae3d07d5643d20
struct_assignment: handle memcpy(foo, ...) where foo is not a struct

The code in question looks like this:

__be32 foo = 0;
memcpy(&foo, skb->data, sizeof(foo));

We want to say that "foo" is no longer zero so we create a fake assignment
for that.  Most of the time we won't know what the end value of "foo" is
but it's important to record that it changed.

I know that the name of this function said "struct" but this seemed like
the most natural place to put this.

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