| 1789 | } |
| 1790 | |
| 1791 | bool Library::isnoreturn(const Token *ftok) const |
| 1792 | { |
| 1793 | if (ftok->function() && ftok->function()->isAttributeNoreturn()) |
| 1794 | return true; |
| 1795 | if (ftok->variable() && ftok->variable()->nameToken()->isAttributeNoreturn()) |
| 1796 | return true; |
| 1797 | if (isNotLibraryFunction(ftok)) { |
| 1798 | if (Token::simpleMatch(ftok->astParent(), ".")) { |
| 1799 | const Token* contTok = ftok->astParent()->astOperand1(); |
| 1800 | if (astContainerAction(contTok, *this) != Library::Container::Action::NO_ACTION || |
| 1801 | astContainerYield(contTok, *this) != Library::Container::Yield::NO_YIELD) |
| 1802 | return false; |
| 1803 | } |
| 1804 | return false; |
| 1805 | } |
| 1806 | const auto it = utils::as_const(mData->mNoReturn).find(getFunctionName(ftok)); |
| 1807 | if (it == mData->mNoReturn.end()) |
| 1808 | return false; |
| 1809 | if (it->second == LibraryData::FalseTrueMaybe::Maybe) |
| 1810 | return true; |
| 1811 | return it->second == LibraryData::FalseTrueMaybe::True; |
| 1812 | } |
| 1813 | |
| 1814 | bool Library::isnotnoreturn(const Token *ftok) const |
| 1815 | { |
no test coverage detected