File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -608,6 +608,8 @@ struct ValueFlowAnalyzer : Analyzer {
608608 for (const ValueFlow::Value& v:ref->astOperand1 ()->values ()) {
609609 if (!v.isLocalLifetimeValue ())
610610 continue ;
611+ if (v.conditional )
612+ continue ;
611613 if (lifeTok)
612614 return Action::None;
613615 lifeTok = v.tokvalue ;
Original file line number Diff line number Diff line change @@ -7936,6 +7936,20 @@ class TestUninitVar : public TestFixture {
79367936 " return s;\n "
79377937 " }\n " );
79387938 ASSERT_EQUALS (" " , errout_str ());
7939+
7940+ valueFlowUninit (" struct S { int i; };\n " // #14191
7941+ " bool g(S*);\n "
7942+ " void f( struct S *p) {\n "
7943+ " struct S s;\n "
7944+ " if (!p) {\n "
7945+ " p = &s;\n "
7946+ " if (g(p))\n "
7947+ " return;\n "
7948+ " }\n "
7949+ " printf(\" %i\" , p->i);\n "
7950+ " p = &s;\n "
7951+ " }\n " );
7952+ ASSERT_EQUALS (" " , errout_str ());
79397953 }
79407954
79417955 template <size_t size>
You can’t perform that action at this time.
0 commit comments