aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-03-30 09:11:44 +0200
committerBjörn-Egil Dahlberg <[email protected]>2015-03-30 09:11:44 +0200
commit346fb20cc0eb84a4ed9758d39ec41bea76ed6999 (patch)
tree71df712b011aafdc610da772e07171dd4e2d746e /erts/emulator/beam
parentf4339951b2d4453314643e805613672e7d7e30ad (diff)
parent43b489d3901543251a6a1a49cb899b5b199864ba (diff)
downloadotp-346fb20cc0eb84a4ed9758d39ec41bea76ed6999.tar.gz
otp-346fb20cc0eb84a4ed9758d39ec41bea76ed6999.tar.bz2
otp-346fb20cc0eb84a4ed9758d39ec41bea76ed6999.zip
Merge branch 'egil/fix-make_internal_hash-float'
* egil/fix-make_internal_hash-float: erts: Add tests for internal_hash erts: Fix make_internal_hash for 0.0 vs -0.0
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/utils.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c
index 8fc8962e4f..91f4accd30 100644
--- a/erts/emulator/beam/utils.c
+++ b/erts/emulator/beam/utils.c
@@ -1894,10 +1894,12 @@ make_internal_hash(Eterm term)
{
FloatDef ff;
GET_DOUBLE(term, ff);
+ if (ff.fd == 0.0) {
+ ff.fd = 0.0; /* ensure pos. 0.0 */
+ }
UINT32_HASH_2(ff.fw[0], ff.fw[1], HCONST_12);
goto pop_next;
}
-
default:
erl_exit(1, "Invalid tag in make_hash2(0x%X)\n", term);
}