diff options
author | Sverker Eriksson <[email protected]> | 2010-07-08 14:43:19 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2010-07-08 14:43:19 +0200 |
commit | d2f1c68969d2c32a1310aa52b66209ef4c3aed97 (patch) | |
tree | 65b6fc77bf8d9a5d52975e53bb279c6bf382cee2 /erts/emulator/beam | |
parent | 816534bc6eac4cd5e617eec48db0a25428aa4794 (diff) | |
parent | 32494dbba73ef1668555b793ead34f94e8bb792b (diff) | |
download | otp-d2f1c68969d2c32a1310aa52b66209ef4c3aed97.tar.gz otp-d2f1c68969d2c32a1310aa52b66209ef4c3aed97.tar.bz2 otp-d2f1c68969d2c32a1310aa52b66209ef4c3aed97.zip |
Merge branch 'sverker/driver_int64_bug/OTP-8716' into dev
* sverker/driver_int64_bug/OTP-8716:
Fix bug that caused faulty 64-bit integers from drivers.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r-- | erts/emulator/beam/big.c | 8 | ||||
-rw-r--r-- | erts/emulator/beam/utils.c | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/erts/emulator/beam/big.c b/erts/emulator/beam/big.c index 90d3a0304a..2d250f32cf 100644 --- a/erts/emulator/beam/big.c +++ b/erts/emulator/beam/big.c @@ -1509,14 +1509,14 @@ Eterm erts_uint64_to_big(Uint64 x, Eterm **hpp) *hp = make_pos_bignum_header(2); BIG_DIGIT(hp, 0) = (Uint) (x & ((Uint) 0xffffffff)); BIG_DIGIT(hp, 1) = (Uint) ((x >> 32) & ((Uint) 0xffffffff)); - *hpp += 2; + *hpp += 3; } else #endif { *hp = make_pos_bignum_header(1); BIG_DIGIT(hp, 0) = (Uint) x; - *hpp += 1; + *hpp += 2; } return make_big(hp); } @@ -1539,7 +1539,7 @@ Eterm erts_sint64_to_big(Sint64 x, Eterm **hpp) *hp = make_pos_bignum_header(2); BIG_DIGIT(hp, 0) = (Uint) (x & ((Uint) 0xffffffff)); BIG_DIGIT(hp, 1) = (Uint) ((x >> 32) & ((Uint) 0xffffffff)); - *hpp += 2; + *hpp += 3; } else #endif @@ -1549,7 +1549,7 @@ Eterm erts_sint64_to_big(Sint64 x, Eterm **hpp) else *hp = make_pos_bignum_header(1); BIG_DIGIT(hp, 0) = (Uint) x; - *hpp += 1; + *hpp += 2; } return make_big(hp); } diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c index da6f9ed12f..b8d407f5e5 100644 --- a/erts/emulator/beam/utils.c +++ b/erts/emulator/beam/utils.c @@ -409,7 +409,7 @@ erts_bld_uint64(Uint **hpp, Uint *szp, Uint64 ui64) } else { if (szp) - *szp = ERTS_UINT64_HEAP_SIZE(ui64); + *szp += ERTS_UINT64_HEAP_SIZE(ui64); if (hpp) res = erts_uint64_to_big(ui64, hpp); } @@ -426,7 +426,7 @@ erts_bld_sint64(Uint **hpp, Uint *szp, Sint64 si64) } else { if (szp) - *szp = ERTS_SINT64_HEAP_SIZE(si64); + *szp += ERTS_SINT64_HEAP_SIZE(si64); if (hpp) res = erts_sint64_to_big(si64, hpp); } |