Fixing UB by using memcpy instead of old style cast

[SVN r82218]
This commit is contained in:
Thomas Heller
2012-12-27 10:49:19 +00:00
parent 061e0d9d6d
commit 7e162c4f03

View File

@@ -73,7 +73,9 @@ namespace boost
ptr += sizeof(std::size_t);
while(length >= sizeof(std::size_t)) {
hash_float_combine(seed, *(std::size_t*) ptr);
std::size_t buffer = 0;
std::memcpy(&buffer, ptr, sizeof(std::size_t));
hash_float_combine(seed, buffer);
length -= sizeof(std::size_t);
ptr += sizeof(std::size_t);
}