diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 92c7316..ec7f8a6 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -662,7 +662,7 @@ public: return StringEqual(rhs); case kNumberType: - if (IsDouble() || rhs.GetDouble()) + if (IsDouble() || rhs.IsDouble()) return GetDouble() == rhs.GetDouble(); // May convert one operand from integer to double. else return data_.n.u64 == rhs.data_.n.u64; diff --git a/test/unittest/valuetest.cpp b/test/unittest/valuetest.cpp index 9324813..e165452 100644 --- a/test/unittest/valuetest.cpp +++ b/test/unittest/valuetest.cpp @@ -135,6 +135,11 @@ TEST(Value, equalto_operator) { TestEqual(x, y); TestEqual(y, z); TestEqual(z, x); + + // Issue #129: compare Uint64 + x.SetUint64(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFF0)); + y.SetUint64(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF)); + TestUnequal(x, y); } template