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

Method executeAll

lib/programmemory.cpp:1331–1347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1329 }
1330
1331 std::unordered_map<nonneg int, ValueFlow::Value> executeAll(const std::vector<const Token*>& toks,
1332 const bool* b = nullptr) const
1333 {
1334 std::unordered_map<nonneg int, ValueFlow::Value> result;
1335 auto state = *this;
1336 for (const Token* tok : toks) {
1337 ValueFlow::Value r = state.execute(tok);
1338 if (r.isUninitValue())
1339 continue;
1340 const bool brk = b && isTrueOrFalse(r, *b);
1341 result.emplace(tok->exprId(), std::move(r));
1342 // Short-circuit evaluation
1343 if (brk)
1344 break;
1345 }
1346 return result;
1347 }
1348
1349 static std::vector<const Token*> flattenConditions(const Token* tok)
1350 {

Callers

nothing calls this directly

Calls 2

isTrueOrFalseFunction · 0.85
executeMethod · 0.45

Tested by

no test coverage detected