Use the already available function scope

This commit is contained in:
Paul 2020-06-29 15:36:01 -05:00
parent a412e3e1f1
commit 67e06c18a9
1 changed files with 0 additions and 3 deletions

View File

@ -4232,9 +4232,6 @@ struct ValueFlowConditionHandler {
// TODO: constValue could be true if there are no assignments in the conditional blocks and // TODO: constValue could be true if there are no assignments in the conditional blocks and
// perhaps if there are no && and no || in the condition // perhaps if there are no && and no || in the condition
bool constValue = false; bool constValue = false;
const Scope* scope = top->scope();
while(scope->nestedIn && scope->type != Scope::eFunction)
scope = scope->nestedIn;
forward(after, scope->bodyEnd, cond.vartok, values, constValue); forward(after, scope->bodyEnd, cond.vartok, values, constValue);
} }
} }