From 25e797875a4324be396420ca54e2766a6f7d96a0 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 25 Jan 2018 17:08:33 +0300 Subject: [PATCH] flow: set loop_count to zero when parsing inline functions I deliberately didn't do this before because it's a trade off. The choice is either mark some returns as impossible when they are actually possible on the second iteration through the loop or mark some returns as possible when they are impossible. Either way is going to cause some confusion. I have decided to mark returns as impossible. This does cause a couple issues where some unpublished code complains that "why are we checking for IS_ERR() when that's not possible". I will write a work around for that eventually. Signed-off-by: Dan Carpenter --- smatch_flow.c | 1 + 1 file changed, 1 insertion(+) diff --git a/smatch_flow.c b/smatch_flow.c index b47e1340..9a1fc379 100644 --- a/smatch_flow.c +++ b/smatch_flow.c @@ -1590,6 +1590,7 @@ static void parse_inline(struct expression *call) sm_debug("inline function: %s\n", cur_func); __unnullify_path(); loop_num = 0; + loop_count = 0; start_function_definition(call->fn->symbol); __split_stmt(base_type->stmt); __split_stmt(base_type->inline_stmt); -- 2.11.4.GIT