diff options
author | Sverker Eriksson <[email protected]> | 2014-01-27 19:30:32 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2014-01-27 19:31:24 +0100 |
commit | bece9227ecffb5f164a383a826f63835bd32175a (patch) | |
tree | 9dc5c751d0d69254aee69c58696c2c314c70069e /erts/emulator/beam/big.c | |
parent | a6ffce4547a3a2c4cb1409a0a679a64b9afdfe9f (diff) | |
parent | 29196a3528e034d3d46ec4589749074f8d766b97 (diff) | |
download | otp-bece9227ecffb5f164a383a826f63835bd32175a.tar.gz otp-bece9227ecffb5f164a383a826f63835bd32175a.tar.bz2 otp-bece9227ecffb5f164a383a826f63835bd32175a.zip |
Merge branch 'sverk/misc-bug-fixes'
OTP-11618
* sverk/misc-bug-fixes:
erts: Fix faulty assert in match spec engine.
erts: Fix crash when comparing very large floats with integers
erts: Refactor big-float compare on HALFWORD to use C-stack
erts: Fix halfword compile errors in ESTACK
Diffstat (limited to 'erts/emulator/beam/big.c')
-rw-r--r-- | erts/emulator/beam/big.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/erts/emulator/beam/big.c b/erts/emulator/beam/big.c index 2b27b111d8..41a041eba6 100644 --- a/erts/emulator/beam/big.c +++ b/erts/emulator/beam/big.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2013. All Rights Reserved. + * Copyright Ericsson AB 1996-2014. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -1603,9 +1603,11 @@ big_to_double(Wterm x, double* resp) /* * Logic has been copied from erl_bif_guard.c and slightly * modified to use a static instead of dynamic heap + * + * HALFWORD: Return relative term with 'heap' as base. */ Eterm -double_to_big(double x, Eterm *heap) +double_to_big(double x, Eterm *heap, Uint hsz) { int is_negative; int ds; @@ -1633,9 +1635,10 @@ double_to_big(double x, Eterm *heap) sz = BIG_NEED_SIZE(ds); /* number of words including arity */ hp = heap; - res = make_big(hp); + res = make_big_rel(hp, heap); xp = (ErtsDigit*) (hp + 1); + ASSERT(ds < hsz); for (i = ds - 1; i >= 0; i--) { ErtsDigit d; |