From d784e85f44e63f33b07ceaa11fc4755ea3c2a8c9 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Wed, 11 Feb 2026 11:40:49 +0100 Subject: [PATCH 1/4] Update reverseanalyzer.cpp --- lib/reverseanalyzer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/reverseanalyzer.cpp b/lib/reverseanalyzer.cpp index 671426f5d2d..6ebceb41b8f 100644 --- a/lib/reverseanalyzer.cpp +++ b/lib/reverseanalyzer.cpp @@ -298,13 +298,13 @@ namespace { if (!condTok) break; Analyzer::Action condAction = analyzeRecursive(condTok); + if (condAction.isModified()) + break; const bool inLoop = Token::Match(condTok->astTop()->previous(), "for|while ("); // Evaluate condition of for and while loops first if (inLoop) { if (Token::findmatch(tok->link(), "goto|break", tok)) break; - if (condAction.isModified()) - break; valueFlowGenericForward(condTok, analyzer, tokenlist, errorLogger, settings); } Token* thenEnd; From 9295246a0a49d4548432c85f179934526691baa9 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Wed, 11 Feb 2026 11:42:10 +0100 Subject: [PATCH 2/4] Update testnullpointer.cpp --- test/testnullpointer.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp index 96e188075e4..d39ac20ccb7 100644 --- a/test/testnullpointer.cpp +++ b/test/testnullpointer.cpp @@ -3787,6 +3787,21 @@ class TestNullPointer : public TestFixture { " g(x);\n" "}"); ASSERT_EQUALS("", errout_str()); + + check("struct T {\n" // #14477 + " bool b{};\n" + " T* next{};\n" + "};\n" + "bool g(const T*& r) {\n" + " const T* t = r;\n" + " r = t->next;\n" + " return t->b;\n" + "}\n" + "void f(const T* tok) {\n" + " if (g(tok)) {}\n" + " if (tok) {}\n" + "}\n"); + ASSERT_EQUALS("", errout_str()); } void nullpointerExit() { From 40f36512fe0ba6ea9b201697dbadcbf5ac76dab3 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Wed, 11 Feb 2026 11:42:47 +0100 Subject: [PATCH 3/4] Update testnullpointer.cpp --- test/testnullpointer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp index d39ac20ccb7..f2664b05285 100644 --- a/test/testnullpointer.cpp +++ b/test/testnullpointer.cpp @@ -3788,7 +3788,7 @@ class TestNullPointer : public TestFixture { "}"); ASSERT_EQUALS("", errout_str()); - check("struct T {\n" // #14477 + check("struct T {\n" // #14308 " bool b{};\n" " T* next{};\n" "};\n" From 650c8ff678a2e956b421cb19f4a7fa215923ec18 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Wed, 11 Feb 2026 12:30:34 +0100 Subject: [PATCH 4/4] Update .selfcheck_suppressions --- .selfcheck_suppressions | 2 -- 1 file changed, 2 deletions(-) diff --git a/.selfcheck_suppressions b/.selfcheck_suppressions index 764b8818308..69885eb2263 100644 --- a/.selfcheck_suppressions +++ b/.selfcheck_suppressions @@ -1,8 +1,6 @@ missingIncludeSystem # should not be reported - see #13387 checkersReport -# false positive - see #14308 -nullPointerRedundantCheck:externals/simplecpp/simplecpp.cpp:3246 # warnings in Qt generated code we cannot fix funcArgNamesDifferent:*/moc_checkthread.cpp