valueFlowContainerReverse: Fix FPs when there is assignment

This commit is contained in:
Daniel Marjamäki 2018-08-10 12:26:53 +02:00
parent 907f81d059
commit f37434cd1d
1 changed files with 2 additions and 0 deletions

View File

@ -3420,6 +3420,8 @@ static void valueFlowContainerReverse(const Token *tok, unsigned int containerId
break; break;
if (tok->varId() != containerId) if (tok->varId() != containerId)
continue; continue;
if (Token::Match(tok, "%name% ="))
break;
if (!tok->valueType() || !tok->valueType()->container) if (!tok->valueType() || !tok->valueType()->container)
continue; continue;
if (Token::Match(tok, "%name% . %name% (") && tok->valueType()->container->getAction(tok->strAt(2)) != Library::Container::Action::NO_ACTION) if (Token::Match(tok, "%name% . %name% (") && tok->valueType()->container->getAction(tok->strAt(2)) != Library::Container::Action::NO_ACTION)