simplifyIfAddBraces : Fixed segmentation fault
This commit is contained in:
parent
a148e67168
commit
30c86f7107
|
@ -1220,7 +1220,7 @@ bool Tokenizer::simplifyIfAddBraces()
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
for ( TOKEN *tok = _tokens; tok; tok = tok->next() )
|
for ( TOKEN *tok = _tokens; tok; tok = tok ? tok->next() : NULL )
|
||||||
{
|
{
|
||||||
if ( ! TOKEN::Match(tok, "if|for|while (") )
|
if ( ! TOKEN::Match(tok, "if|for|while (") )
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue