MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / valueFlowSetConditionToKnown

Function valueFlowSetConditionToKnown

lib/valueflow.cpp:4291–4301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4289}
4290
4291static void valueFlowSetConditionToKnown(const Token* tok, std::list<ValueFlow::Value>& values, bool then)
4292{
4293 if (values.empty())
4294 return;
4295 if (then && !Token::Match(tok, "==|!|("))
4296 return;
4297 if (!then && !Token::Match(tok, "!=|%var%|("))
4298 return;
4299 if (isConditionKnown(tok, then))
4300 changePossibleToKnown(values);
4301}
4302
4303static bool isBreakScope(const Token* const endToken)
4304{

Callers 1

afterConditionMethod · 0.85

Calls 3

isConditionKnownFunction · 0.85
changePossibleToKnownFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected