diff --git a/lib/executionpath.cpp b/lib/executionpath.cpp index 02afc38c5..bfda0f410 100644 --- a/lib/executionpath.cpp +++ b/lib/executionpath.cpp @@ -186,8 +186,11 @@ static void checkExecutionPaths_(const Token *tok, std::list &c // ?: => bailout if (tok->str() == "?") { - ExecutionPath::bailOut(checks); - return; + for (const Token *tok2 = tok; tok2 && tok2->str() != ";"; tok2 = tok2->next()) + { + if (tok2->varId() > 0) + ExecutionPath::bailOutVar(checks, tok2->varId()); + } } if (tok->str() == "switch") diff --git a/test/testother.cpp b/test/testother.cpp index a57e21d4e..3b85d07df 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -1817,6 +1817,13 @@ private: "}\n"); ASSERT_EQUALS("", errout.str()); + checkUninitVar("void foo(int a, int b)\n" + "{\n" + " int x; x = (a