mirror of
https://github.com/boostorg/functional.git
synced 2025-08-01 21:44:28 +02:00
Hash: Merge UB fix to release.
[SVN r82256]
This commit is contained in:
@@ -150,5 +150,6 @@
|
||||
* On platforms that are known to have standard floating point, don't use the
|
||||
automatic detection of floating point functions - which can break if there
|
||||
are ambiguous overloads.
|
||||
* Fix undefined behaviour when using the binary float hash (Thomas Heller).
|
||||
|
||||
[endsect]
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user