Attempt to fix crashs on clang test suite.

This commit is contained in:
PKEuS 2014-09-01 23:29:15 +02:00
parent 00044aabb0
commit 428f7a6f26
1 changed files with 3 additions and 1 deletions

View File

@ -594,7 +594,9 @@ void CheckOther::checkRedundantAssignment()
writtenArgumentsEnd = 0;
if (tok->str() == "?" && tok->astOperand2()) {
tok = Token::findsimplematch(tok->astOperand2(), ";");
tok = Token::findmatch(tok->astOperand2(), ";|}");
if (!tok)
break;
varAssignments.clear();
memAssignments.clear();
} else if (tok->str() == "{" && tok->strAt(-1) != "{" && tok->strAt(-1) != "=" && tok->strAt(-4) != "case" && tok->strAt(-3) != "default") { // conditional or non-executable inner scope: Skip it and reset status