aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/big.c
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2014-01-28 11:06:43 +0100
committerIngela Anderton Andin <[email protected]>2014-01-28 11:06:43 +0100
commitbb5b33bd3a7c8cbb97695c00f4b9b0d89121f861 (patch)
tree94dae2ff490c4193df939fc85927ac63af9542e1 /erts/emulator/beam/big.c
parent75bfbe5a61fa1a1dd204fdb21dc4bf7df8e8003d (diff)
parent2b57228dd5993321a217a89dbe601d1e90b18f33 (diff)
downloadotp-bb5b33bd3a7c8cbb97695c00f4b9b0d89121f861.tar.gz
otp-bb5b33bd3a7c8cbb97695c00f4b9b0d89121f861.tar.bz2
otp-bb5b33bd3a7c8cbb97695c00f4b9b0d89121f861.zip
Merge branch 'master' of super:otp
Diffstat (limited to 'erts/emulator/beam/big.c')
-rw-r--r--erts/emulator/beam/big.c9
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;