Commit f15bfccb authored by Dominik Charousset's avatar Dominik Charousset

Fix misaligned pointer use

parent 02b525bb
......@@ -100,7 +100,8 @@ bool node_id::default_data::valid() const noexcept {
size_t node_id::default_data::hash_code() const noexcept {
// XOR the first few bytes from the node ID and the process ID.
auto x = static_cast<size_t>(pid_);
auto y = *reinterpret_cast<const size_t*>(host_.data());
size_t y;
memcpy(&y, host_.data(), sizeof(size_t));
return x ^ y;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment