Tokenizer::simplifyFlowControl: separated the 'throw' case because it's not a reserved keyword in C, hence the function shouldn't simplify in C source files.
This commit is contained in:
parent
77b8e496d6
commit
d68d035e22
|
@ -3649,7 +3649,8 @@ void Tokenizer::simplifyFlowControl()
|
||||||
eraseDeadCode(tok, 0);
|
eraseDeadCode(tok, 0);
|
||||||
|
|
||||||
} else if (Token::Match(tok,"return|goto") ||
|
} else if (Token::Match(tok,"return|goto") ||
|
||||||
(Token::Match(tok,"exit|throw|abort") && !Token::Match(tok->previous(),"%type%"))) {
|
(Token::Match(tok,"exit|abort") && !Token::Match(tok->previous(),"%type%")) ||
|
||||||
|
(tok->str() == "throw" && !isC())) {
|
||||||
//catch the first ';'
|
//catch the first ';'
|
||||||
for (Token *tok2 = tok->next(); tok2; tok2 = tok2->next()) {
|
for (Token *tok2 = tok->next(); tok2; tok2 = tok2->next()) {
|
||||||
if (tok2->str() == "(" || tok2->str() == "[") {
|
if (tok2->str() == "(" || tok2->str() == "[") {
|
||||||
|
|
Loading…
Reference in New Issue