unreachableCode: avoid SIGSEGV when there is no "}" after return.
This commit is contained in:
parent
1a14cd527c
commit
f33153e086
|
@ -809,6 +809,9 @@ void CheckOther::unreachableCode()
|
|||
while (tok && Token::Match(tok->next(), ";"))
|
||||
tok = tok->next();
|
||||
|
||||
if (!tok)
|
||||
break;
|
||||
|
||||
// If there is a statement below the return it is unreachable
|
||||
if (!Token::Match(tok, "; case|default|}|#") && !Token::Match(tok, "; %var% :"))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue