buf_size: remove the &* and [0] from around the pointer earlier
commit69136cd09bfb379fc7bed31165fb6db077c9a00e
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 18 Jun 2012 08:05:55 +0000 (18 11:05 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Mon, 18 Jun 2012 08:05:55 +0000 (18 11:05 +0300)
tree8c795df4ef6abc85d0722f806cdddabd6466e103
parent87e1db881a8f3e8e8a520fc107ca276e6066c277
buf_size: remove the &* and [0] from around the pointer earlier

The situation is that &p[0] is the same as 'p'.  We handled this already
for regular arrays, but not if the array was dynamically allocated.  So
I've moved it forward.

I had to make get_real_array_size() ignore EXPR_BINOP because now it
has to handle &array[5] which is not the same size as &array[0].  It's not
clear if we should return the size of the element or the size of the the
array minus the first 5 elements, but for now we just call it unknown.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_buf_size.c
validation/sm_buf_size6.c [new file with mode: 0644]