File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4811,19 +4811,23 @@ struct ConditionHandler {
48114811 return ;
48124812 }
48134813
4814+ if (cond.true_values .empty () && cond.false_values .empty ())
4815+ return ;
4816+
48144817 std::list<ValueFlow::Value> values = cond.true_values ;
48154818 if (cond.true_values != cond.false_values )
48164819 values.insert (values.end (), cond.false_values .cbegin (), cond.false_values .cend ());
48174820
48184821 // extra logic for unsigned variables 'i>=1' => possible value can also be 0
48194822 if (Token::Match (tok, " <|>|<=|>=" )) {
4823+ if (cond.vartok ->valueType () && cond.vartok ->valueType ()->sign != ValueType::Sign::UNSIGNED)
4824+ return ;
4825+
48204826 values.remove_if ([](const ValueFlow::Value& v) {
48214827 if (v.isIntValue ())
48224828 return v.intvalue != 0 ;
48234829 return false ;
48244830 });
4825- if (cond.vartok ->valueType () && cond.vartok ->valueType ()->sign != ValueType::Sign::UNSIGNED)
4826- return ;
48274831 }
48284832 if (values.empty ())
48294833 return ;
You can’t perform that action at this time.
0 commit comments