ExprEngine; Check struct member assignment

This commit is contained in:
Daniel Marjamäki 2020-01-21 20:29:13 +01:00
parent 263f80deb8
commit 6a07c2f71a
1 changed files with 2 additions and 0 deletions

View File

@ -2074,6 +2074,8 @@ void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer,
if (!Token::simpleMatch(tok->astParent(), "=")) if (!Token::simpleMatch(tok->astParent(), "="))
return; return;
const Token *lhs = tok->astParent()->astOperand1(); const Token *lhs = tok->astParent()->astOperand1();
while (Token::simpleMatch(lhs, "."))
lhs = lhs->astOperand2();
if (!lhs || !lhs->variable() || !lhs->variable()->nameToken()) if (!lhs || !lhs->variable() || !lhs->variable()->nameToken())
return; return;