diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index f4632ffac..cb88a1cba 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -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(); diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index c9fc2f590..fa8e5b5bf 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -3075,6 +3075,8 @@ private: std::list 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");