File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4813,19 +4813,23 @@ struct ConditionHandler {
48134813 return ;
48144814 }
48154815
4816+ if (cond.true_values .empty () && cond.false_values .empty ())
4817+ return ;
4818+
48164819 std::list<ValueFlow::Value> values = cond.true_values ;
48174820 if (cond.true_values != cond.false_values )
48184821 values.insert (values.end (), cond.false_values .cbegin (), cond.false_values .cend ());
48194822
48204823 // extra logic for unsigned variables 'i>=1' => possible value can also be 0
48214824 if (Token::Match (tok, " <|>|<=|>=" )) {
4825+ if (cond.vartok ->valueType () && cond.vartok ->valueType ()->sign != ValueType::Sign::UNSIGNED)
4826+ return ;
4827+
48224828 values.remove_if ([](const ValueFlow::Value& v) {
48234829 if (v.isIntValue ())
48244830 return v.intvalue != 0 ;
48254831 return false ;
48264832 });
4827- if (cond.vartok ->valueType () && cond.vartok ->valueType ()->sign != ValueType::Sign::UNSIGNED)
4828- return ;
48294833 }
48304834 if (values.empty ())
48314835 return ;
You can’t perform that action at this time.
0 commit comments