summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/slice2objc/Gen.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/cpp/src/slice2objc/Gen.cpp b/cpp/src/slice2objc/Gen.cpp
index d3316087916..e3b471d11f4 100644
--- a/cpp/src/slice2objc/Gen.cpp
+++ b/cpp/src/slice2objc/Gen.cpp
@@ -2046,7 +2046,7 @@ Slice::Gen::TypesVisitor::writeMemberHashCode(const DataMemberList& dataMembers,
case Builtin::KindDouble:
{
_M << sb;
- _M << nl << "unsigned long long bits_ = (unsigned long long)" << name << ";";
+ _M << nl << "unsigned long long bits_ = *(unsigned long long*)&" << name << ";";
_M << nl << "h_ = ((h_ << 5) + h_) ^ (uint)(bits_ ^ (bits_ >> 32));";
_M << eb;
break;