From 8414c8cee88230eb6590fd46aaad798c06c7d6f2 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 23 Nov 2012 09:34:10 +0300 Subject: [PATCH] type: cleanp get_member_symbol() I want to use a temporary pointer here. I noticed this in reading the code. I don't know that it causes a problem to mess with the iterator pointer, but it looks wrong to me. Signed-off-by: Dan Carpenter --- smatch_type.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/smatch_type.c b/smatch_type.c index 4a132e0f..6f7db2fb 100644 --- a/smatch_type.c +++ b/smatch_type.c @@ -82,14 +82,14 @@ static struct symbol *get_type_symbol(struct expression *expr) static struct symbol *get_member_symbol(struct symbol_list *symbol_list, struct ident *member) { - struct symbol *tmp; + struct symbol *tmp, *sub; FOR_EACH_PTR(symbol_list, tmp) { if (!tmp->ident) { - tmp = get_real_base_type(tmp); - tmp = get_member_symbol(tmp->symbol_list, member); - if (tmp) - return tmp; + sub = get_real_base_type(tmp); + sub = get_member_symbol(sub->symbol_list, member); + if (sub) + return sub; continue; } if (tmp->ident == member) -- 2.11.4.GIT