Verification; Avoid crash

This commit is contained in:
Daniel Marjamäki 2019-12-27 20:27:21 +01:00
parent 49ed1a82b4
commit ab2e87191f
1 changed files with 2 additions and 0 deletions

View File

@ -1433,6 +1433,8 @@ static void execute(const Token *start, const Token *end, Data &data)
}
if (!Token::Match(tok2->astOperand1(), "%var%"))
throw VerifyException(tok2, "Unhandled assignment in loop");
if (!tok2->astOperand1()->variable())
throw VerifyException(tok2, "Unhandled assignment in loop");
// give variable "any" value
int varid = tok2->astOperand1()->varId();
if (changedVariables.find(varid) != changedVariables.end())