Add 'exit' and 'abort' to the flow control list in order to simplify code after them.
This commit is contained in:
parent
eb5fe250ab
commit
b9224439c1
|
@ -4609,8 +4609,8 @@ void Tokenizer::simplifyFlowControl()
|
|||
tok = tok->next();
|
||||
eraseDeadCode(tok, beginindent->link());
|
||||
|
||||
} else if (tok->str() == "return" || tok->str() == "throw") {
|
||||
//catch the first ';' after the return|trow statement
|
||||
} else if (Token::Match(tok,"return|throw|exit|abort")) {
|
||||
//catch the first ';'
|
||||
for (Token *tok2 = tok->next(); tok2; tok2 = tok2->next()) {
|
||||
if (tok2->str() == "(" || tok2->str() == "[") {
|
||||
tok2 = tok2->link();
|
||||
|
|
|
@ -3075,6 +3075,8 @@ private:
|
|||
std::list<std::string> beforedead;
|
||||
beforedead.push_back("return");
|
||||
beforedead.push_back("throw ( 10 )");
|
||||
beforedead.push_back("exit ( 0 )");
|
||||
beforedead.push_back("abort ( )");
|
||||
beforedead.push_back("goto labels");
|
||||
beforedead.push_back("break");
|
||||
beforedead.push_back("continue");
|
||||
|
|
Loading…
Reference in New Issue