File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -486,17 +486,15 @@ namespace ValueFlow
486486 continue ;
487487 result.valueType = Value::ValueType::FLOAT;
488488 }
489- const double floatValue1 = value1.isFloatValue () ? value1.floatValue : static_cast <double >(value1.intvalue );
490- const double floatValue2 = value2.isFloatValue () ? value2.floatValue : static_cast <double >(value2.intvalue );
491489 const bool isFloat = value1.isFloatValue () || value2.isFloatValue ();
490+ if (isFloat && Token::Match (parent, " &|^|%|<<|>>|==|!=|%or%" ))
491+ continue ;
492492 const auto intValue1 = [&]() -> MathLib::bigint {
493493 return value1.isFloatValue () ? static_cast <MathLib::bigint>(value1.floatValue ) : value1.intvalue ;
494494 };
495495 const auto intValue2 = [&]() -> MathLib::bigint {
496496 return value2.isFloatValue () ? static_cast <MathLib::bigint>(value2.floatValue ) : value2.intvalue ;
497497 };
498- if ((value1.isFloatValue () || value2.isFloatValue ()) && Token::Match (parent, " &|^|%|<<|>>|==|!=|%or%" ))
499- continue ;
500498 if (Token::Match (parent, " ==|!=" )) {
501499 if ((value1.isIntValue () && value2.isTokValue ()) || (value1.isTokValue () && value2.isIntValue ())) {
502500 if (parent->str () == " ==" )
@@ -551,6 +549,8 @@ namespace ValueFlow
551549 }
552550 bool error = false ;
553551 if (isFloat) {
552+ const double floatValue1 = value1.isFloatValue () ? value1.floatValue : static_cast <double >(value1.intvalue );
553+ const double floatValue2 = value2.isFloatValue () ? value2.floatValue : static_cast <double >(value2.intvalue );
554554 auto val = calculate (parent->str (), floatValue1, floatValue2, &error);
555555 if (result.isFloatValue ()) {
556556 result.floatValue = val;
You can’t perform that action at this time.
0 commit comments