aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Weißl <[email protected]>2013-06-14 15:23:54 +0200
committerJohannes Weißl <[email protected]>2013-06-14 15:25:12 +0200
commit29465408c90b2271b68e9559b5482fc6c4fcdde5 (patch)
tree869dc2006c3ed5d8c725126e48f0e2cfdaecad23
parent55d6274f67cafe62e4923a6369c99a45822cb767 (diff)
downloadotp-29465408c90b2271b68e9559b5482fc6c4fcdde5.tar.gz
otp-29465408c90b2271b68e9559b5482fc6c4fcdde5.tar.bz2
otp-29465408c90b2271b68e9559b5482fc6c4fcdde5.zip
Fix erlang:phash2() on floating point middle-endian machines
This complements 933e701 (OTP-10209). Without this patch the test case "hash_SUITE:test_phash2/1" fails. Simple error example: 1> 77147068 = erlang:phash2(1.0). ** exception error: no match of right hand side value 50524433
-rw-r--r--erts/emulator/beam/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c
index 62caa67ce1..ccc411462e 100644
--- a/erts/emulator/beam/utils.c
+++ b/erts/emulator/beam/utils.c
@@ -1319,7 +1319,7 @@ make_hash2(Eterm term)
{
FloatDef ff;
GET_DOUBLE(term, ff);
-#if defined(WORDS_BIGENDIAN)
+#if defined(WORDS_BIGENDIAN) || defined(DOUBLE_MIDDLE_ENDIAN)
UINT32_HASH_2(ff.fw[0], ff.fw[1], HCONST_12);
#else
UINT32_HASH_2(ff.fw[1], ff.fw[0], HCONST_12);