| 7173 | } |
| 7174 | |
| 7175 | static void valueFlowDebug(TokenList& tokenlist, ErrorLogger& errorLogger, const Settings& settings) |
| 7176 | { |
| 7177 | if (!settings.debugnormal && !settings.debugwarnings) |
| 7178 | return; |
| 7179 | for (Token* tok = tokenlist.front(); tok; tok = tok->next()) { |
| 7180 | if (tok->getTokenDebug() != TokenDebug::ValueFlow) |
| 7181 | continue; |
| 7182 | if (tok->astParent() && tok->astParent()->getTokenDebug() == TokenDebug::ValueFlow) |
| 7183 | continue; |
| 7184 | for (const ValueFlow::Value& v : tok->values()) { |
| 7185 | std::string msg = "The value is " + debugString(v); |
| 7186 | ErrorPath errorPath = v.errorPath; |
| 7187 | errorPath.insert(errorPath.end(), v.debugPath.cbegin(), v.debugPath.cend()); |
| 7188 | errorPath.emplace_back(tok, ""); |
| 7189 | errorLogger.reportErr({std::move(errorPath), &tokenlist, Severity::debug, "valueFlow", msg, CWE{0}, Certainty::normal}); |
| 7190 | } |
| 7191 | } |
| 7192 | } |
| 7193 | |
| 7194 | const ValueFlow::Value *ValueFlow::valueFlowConstantFoldAST(Token *expr, const Settings &settings) |
| 7195 | { |