File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -445,10 +445,12 @@ void CheckOther::invalidPointerCast()
445
445
nextTok = nextTok->next ();
446
446
toTok = tok->tokAt (2 );
447
447
}
448
+ if (!nextTok)
449
+ continue ;
448
450
if (toTok && toTok->str () == " const" )
449
451
toTok = toTok->next ();
450
452
451
- if (!nextTok || ! toTok || !toTok->isStandardType ())
453
+ if (!toTok || !toTok->isStandardType ())
452
454
continue ;
453
455
454
456
// Find casted variable
@@ -649,7 +651,7 @@ void CheckOther::checkRedundantAssignment()
649
651
}
650
652
}
651
653
if (error) {
652
- if (scope->type == Scope::eSwitch && Token::findmatch (it->second , " default|case" , tok) && warning )
654
+ if (warning && scope->type == Scope::eSwitch && Token::findmatch (it->second , " default|case" , tok))
653
655
redundantAssignmentInSwitchError (it->second , tok, tok->str ());
654
656
else if (performance) {
655
657
const bool nonlocal = nonLocal (it->second ->variable ());
You can’t perform that action at this time.
0 commit comments