diff options
author | Rickard Green <[email protected]> | 2010-11-18 10:37:10 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2010-11-18 10:37:10 +0100 |
commit | bce98193540c0f5f1e315a07ba4870056e7693c9 (patch) | |
tree | 4bb650b1e703c097c8196fa65d574044d6d32a46 /erts/emulator/beam/io.c | |
parent | de28ddf034eea6cf05f2e87eee1a3424c89b92f7 (diff) | |
parent | e6f87189ab73c9ae857543b51c19a047947f1533 (diff) | |
download | otp-bce98193540c0f5f1e315a07ba4870056e7693c9.tar.gz otp-bce98193540c0f5f1e315a07ba4870056e7693c9.tar.bz2 otp-bce98193540c0f5f1e315a07ba4870056e7693c9.zip |
Merge branch 'rickard/halfword-fix/OTP-8910' into dev
* rickard/halfword-fix/OTP-8910:
Fix ERL_DRV_INT and ERL_DRV_UINT in halfword emulator
Diffstat (limited to 'erts/emulator/beam/io.c')
-rw-r--r-- | erts/emulator/beam/io.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c index 79022d5dd7..9ed92bbe03 100644 --- a/erts/emulator/beam/io.c +++ b/erts/emulator/beam/io.c @@ -2802,17 +2802,25 @@ driver_deliver_term(ErlDrvPort port, break; case ERL_DRV_INT: /* signed int argument */ ERTS_DDT_CHK_ENOUGH_ARGS(1); +#if HALFWORD_HEAP + erts_bld_sint64(NULL, &need, (Sint64)ptr[0]); +#else /* check for bignum */ if (!IS_SSMALL((Sint)ptr[0])) need += BIG_UINT_HEAP_SIZE; /* use small_to_big */ +#endif ptr++; depth++; break; case ERL_DRV_UINT: /* unsigned int argument */ ERTS_DDT_CHK_ENOUGH_ARGS(1); +#if HALFWORD_HEAP + erts_bld_uint64(NULL, &need, (Uint64)ptr[0]); +#else /* check for bignum */ if (!IS_USMALL(0, (Uint)ptr[0])) need += BIG_UINT_HEAP_SIZE; /* use small_to_big */ +#endif ptr++; depth++; break; @@ -2979,22 +2987,30 @@ driver_deliver_term(ErlDrvPort port, break; case ERL_DRV_INT: /* signed int argument */ +#if HALFWORD_HEAP + mess = erts_bld_sint64(&hp, NULL, (Sint64)ptr[0]); +#else if (IS_SSMALL((Sint)ptr[0])) mess = make_small((Sint)ptr[0]); else { mess = small_to_big((Sint)ptr[0], hp); hp += BIG_UINT_HEAP_SIZE; } +#endif ptr++; break; case ERL_DRV_UINT: /* unsigned int argument */ +#if HALFWORD_HEAP + mess = erts_bld_uint64(&hp, NULL, (Uint64)ptr[0]); +#else if (IS_USMALL(0, (Uint)ptr[0])) mess = make_small((Uint)ptr[0]); else { mess = uint_to_big((Uint)ptr[0], hp); hp += BIG_UINT_HEAP_SIZE; } +#endif ptr++; break; |