zero division or useless condition: dont crash when variable declaration is not parsed correctly
This commit is contained in:
parent
5aaaff46ee
commit
c05a80d314
|
@ -2171,7 +2171,9 @@ void CheckOther::checkZeroDivisionOrUselessCondition()
|
|||
if (!var)
|
||||
continue;
|
||||
bool isVarUnsigned = var->typeEndToken()->isUnsigned();
|
||||
for (const Token *typetok = var->typeStartToken(); typetok != var->typeEndToken(); typetok = typetok->next()) {
|
||||
for (const Token *typetok = var->typeStartToken(); typetok; typetok = typetok->next()) {
|
||||
if (!typetok->isName() || typetok == var->typeEndToken())
|
||||
break;
|
||||
if (typetok->isUnsigned()) {
|
||||
isVarUnsigned = true;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue