File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1341,6 +1341,8 @@ namespace {
1341
1341
1342
1342
for (const auto & p : *pm) {
1343
1343
const Token* tok = p.first .tok ;
1344
+ if (!tok)
1345
+ continue ;
1344
1346
const ValueFlow::Value& value = p.second ;
1345
1347
1346
1348
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 {
7275
7275
" if (a && b) {}\n "
7276
7276
" }\n " ;
7277
7277
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, " &&" );
7278
7289
}
7279
7290
7280
7291
void valueFlowHang () {
You can’t perform that action at this time.
0 commit comments