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()
445445 nextTok = nextTok->next ();
446446 toTok = tok->tokAt (2 );
447447 }
448+ if (!nextTok)
449+ continue ;
448450 if (toTok && toTok->str () == " const" )
449451 toTok = toTok->next ();
450452
451- if (!nextTok || ! toTok || !toTok->isStandardType ())
453+ if (!toTok || !toTok->isStandardType ())
452454 continue ;
453455
454456 // Find casted variable
@@ -649,7 +651,7 @@ void CheckOther::checkRedundantAssignment()
649651 }
650652 }
651653 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))
653655 redundantAssignmentInSwitchError (it->second , tok, tok->str ());
654656 else if (performance) {
655657 const bool nonlocal = nonLocal (it->second ->variable ());
You can’t perform that action at this time.
0 commit comments