extra: type bug handling empty states in reset_struct_members()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 6 Feb 2013 08:23:43 +0000 (6 11:23 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 6 Feb 2013 08:23:43 +0000 (6 11:23 +0300)
If we don't know the type then alloc_estate_whole() defaults to long.  It's
the wrong type and it causes a problem.

If we have an empty estate then let's just leave it that way.

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

index 9641646..7399974 100644 (file)
@@ -542,6 +542,8 @@ free:
 
 static void reset_struct_members(struct sm_state *sm)
 {
+       if (!estate_rl(sm->state))
+               return;
        set_extra_mod(sm->name, sm->sym, alloc_estate_whole(estate_type(sm->state)));
 }