GenericValue: fix comparison of (Ui|I)nt64 numbers

Some 64-bit integers cannot be represented losslessly as a double.
Due to a typo in the operator==, the comparison has been performed
after a double conversion in too many cases.
This commit is contained in:
Philipp A. Hartmann 2014-08-31 18:58:14 +02:00
parent 47c32eee6b
commit fd2ba0bc44

View File

@ -662,7 +662,7 @@ public:
return StringEqual(rhs); return StringEqual(rhs);
case kNumberType: case kNumberType:
if (IsDouble() || rhs.GetDouble()) if (IsDouble() || rhs.IsDouble())
return GetDouble() == rhs.GetDouble(); // May convert one operand from integer to double. return GetDouble() == rhs.GetDouble(); // May convert one operand from integer to double.
else else
return data_.n.u64 == rhs.data_.n.u64; return data_.n.u64 == rhs.data_.n.u64;