File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1341,6 +1341,8 @@ namespace {
13411341
13421342 for (const auto & p : *pm) {
13431343 const Token* tok = p.first .tok ;
1344+ if (!tok)
1345+ continue ;
13441346 const ValueFlow::Value& value = p.second ;
13451347
13461348 if (tok->str () == expr->str () && !astHasExpr (tok, expr->exprId ())) {
Original file line number Diff line number Diff line change @@ -7275,6 +7275,17 @@ class TestValueFlow : public TestFixture {
72757275 " if (a && b) {}\n "
72767276 " }\n " ;
72777277 valueOfTok (code, " a" );
7278+
7279+ code = " void g(const char* fmt, ...);\n " // #12255
7280+ " void f(const char* fmt, const char* msg) {\n "
7281+ " const char* p = msg;\n "
7282+ " g(\" %s\" , msg);\n "
7283+ " }\n "
7284+ " void g(const char* fmt, ...) {\n "
7285+ " const char* q = fmt;\n "
7286+ " if (*q > 0 && *q < 100) {}\n "
7287+ " }\n " ;
7288+ valueOfTok (code, " &&" );
72787289 }
72797290
72807291 void valueFlowHang () {
You can’t perform that action at this time.
0 commit comments