From: Dan Carpenter Date: Wed, 6 Feb 2013 08:23:43 +0000 (+0300) Subject: extra: type bug handling empty states in reset_struct_members() X-Git-Tag: 1.57~10 X-Git-Url: https://repo.or.cz/w/smatch.git/commitdiff_plain/8130b37114148ff409386ab2d84e1a4faa2842dd extra: type bug handling empty states in reset_struct_members() 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 --- diff --git a/smatch_extra.c b/smatch_extra.c index 96416462..7399974f 100644 --- a/smatch_extra.c +++ b/smatch_extra.c @@ -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))); }