From 8130b37114148ff409386ab2d84e1a4faa2842dd Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 6 Feb 2013 11:23:43 +0300 Subject: [PATCH] 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 --- smatch_extra.c | 2 ++ 1 file changed, 2 insertions(+) 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))); } -- 2.11.4.GIT