File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -400,9 +400,9 @@ void CheckCondition::oppositeInnerCondition()
400400 nonlocal |= (var && (!var->isLocal () || var->isStatic ()) && !var->isArgument ());
401401 // TODO: if var is pointer check what it points at
402402 nonlocal |= (var && (var->isPointer () || var->isReference ()));
403- } else if (cond->isName ()) {
403+ } else if (!nonlocal && cond->isName ()) {
404404 // varid is 0. this is possibly a nonlocal variable..
405- nonlocal | = Token::Match (cond->astParent (), " %cop%|(" );
405+ nonlocal = Token::Match (cond->astParent (), " %cop%|(" );
406406 }
407407 }
408408
@@ -429,8 +429,8 @@ void CheckCondition::oppositeInnerCondition()
429429 if (Token::Match (tok->previous (), " ++|--|& %name%" ))
430430 break ;
431431 if (tok->variable () &&
432- Token::Match ( tok, " %name% . %name% ( " ) &&
433- ! tok-> variable ()-> isConst ( )) {
432+ ! tok-> variable ()-> isConst ( ) &&
433+ Token::Match ( tok, " %name% . %name% ( " )) {
434434 const Function* function = tok->tokAt (2 )->function ();
435435 if (!function || !function->isConst ())
436436 break ;
You can’t perform that action at this time.
0 commit comments