valueFlowContainerSize: Fix crash when container pointer is null
This commit is contained in:
parent
f37434cd1d
commit
3805af18a2
|
@ -3436,7 +3436,7 @@ static void valueFlowContainerSize(TokenList * /*tokenlist*/, SymbolDatabase* sy
|
||||||
if (scope.type != Scope::ScopeType::eIf) // TODO: while
|
if (scope.type != Scope::ScopeType::eIf) // TODO: while
|
||||||
continue;
|
continue;
|
||||||
for (const Token *tok = scope.classDef; tok && tok->str() != "{"; tok = tok->next()) {
|
for (const Token *tok = scope.classDef; tok && tok->str() != "{"; tok = tok->next()) {
|
||||||
if (!tok->isName() || !tok->valueType() || tok->valueType()->type != ValueType::CONTAINER)
|
if (!tok->isName() || !tok->valueType() || tok->valueType()->type != ValueType::CONTAINER || !tok->valueType()->container)
|
||||||
continue;
|
continue;
|
||||||
if (!Token::Match(tok, "%name% . %name% ("))
|
if (!Token::Match(tok, "%name% . %name% ("))
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue