fixed unlogged errors from the tokenizer and also some errors reported by valgrind
This commit is contained in:
parent
1c69d54fb3
commit
3fb420cbf0
|
@ -1241,8 +1241,8 @@ void CheckMemoryLeakInFunction::simplifycode(Token *tok, bool &all)
|
|||
// Replace "{ }" with ";"
|
||||
if (Token::simpleMatch(tok2->next(), "{ }"))
|
||||
{
|
||||
tok2->next()->str(";");
|
||||
Token::eraseTokens(tok2->next(), tok2->tokAt(3));
|
||||
tok2->eraseTokens(tok2, tok2->tokAt(3));
|
||||
tok2->insertToken(";");
|
||||
done = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -592,10 +592,10 @@ private:
|
|||
|
||||
// switch..
|
||||
ASSERT_EQUALS("; alloc ; dealloc ;", simplifycode(";alloc;switch{case;break;};dealloc;"));
|
||||
ASSERT_EQUALS("; if return ; }", simplifycode("; switch { case ; return ; default ; break ; } }"));
|
||||
ASSERT_EQUALS("; if return ; }", simplifycode("; switch { case ; if { return ; } break ; default ; break ; } }"));
|
||||
ASSERT_EQUALS("; if return ; else use ; }", simplifycode("; switch { case ; return ; default ; use ; break ; } }"));
|
||||
ASSERT_EQUALS("; use ; }", simplifycode("; while1 { loop { ; } switch { case ; dealloc ; return ; default ; break ; } } }"));
|
||||
ASSERT_EQUALS("; if return ;", simplifycode("; switch { case ; return ; default ; break ; }"));
|
||||
ASSERT_EQUALS("; if return ;", simplifycode("; switch { case ; if { return ; } break ; default ; break ; }"));
|
||||
ASSERT_EQUALS("; if return ; else use ;", simplifycode("; switch { case ; return ; default ; use ; break ; }"));
|
||||
ASSERT_EQUALS("; use ;", simplifycode("; while1 { loop { ; } switch { case ; dealloc ; return ; default ; break ; } }"));
|
||||
|
||||
// loops..
|
||||
ASSERT_EQUALS(";", simplifycode("; loop { ; }"));
|
||||
|
|
Loading…
Reference in New Issue