Fixed related issues to #5601

This commit is contained in:
PKEuS 2014-03-22 22:35:20 +01:00
parent 7e74ecca76
commit 8d5be8c4a4
2 changed files with 4 additions and 1 deletions

View File

@ -1608,7 +1608,7 @@ void CheckOther::checkUnreachableCode()
} else if (Token::Match(tok, "goto %any% ;")) {
secondBreak = tok->tokAt(3);
labelName = tok->next();
} else if (Token::Match(tok, "%var% (") && _settings->library.isnoreturn(tok->str())) {
} else if (Token::Match(tok, "%var% (") && _settings->library.isnoreturn(tok->str()) && tok->strAt(-1) != ".") {
if ((!tok->function() || (tok->function()->token != tok && tok->function()->tokenDef != tok)) && tok->linkAt(1)->strAt(1) != "{")
secondBreak = tok->linkAt(1)->tokAt(2);
}

View File

@ -2877,6 +2877,9 @@ private:
"}", 0, false, false, false, false, &settings);
ASSERT_EQUALS("", errout.str());
check("void foo() { xResAccess->exit(); }", 0, false, false, false, false, &settings);
ASSERT_EQUALS("", errout.str());
check("void foo(int a)\n"
"{\n"
" switch(a) {\n"