diff options
author | Richard Carlsson <[email protected]> | 2015-12-03 14:33:53 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-02-08 16:11:56 +0100 |
commit | 14680fcc3fb9d0357fe33a94525d08896afed1c5 (patch) | |
tree | 40b1891cdbe478154d62262616494dbc27eabcf1 /erts/emulator/beam/erl_process_dict.c | |
parent | acc4ac9f421e064bc0e573a9d5ecd26afe7cb8d6 (diff) | |
download | otp-14680fcc3fb9d0357fe33a94525d08896afed1c5.tar.gz otp-14680fcc3fb9d0357fe33a94525d08896afed1c5.tar.bz2 otp-14680fcc3fb9d0357fe33a94525d08896afed1c5.zip |
erts: Use Sint instead of int for list lengths
This avoids potential integer arithmetic overflow for very large lists.
Diffstat (limited to 'erts/emulator/beam/erl_process_dict.c')
-rw-r--r-- | erts/emulator/beam/erl_process_dict.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_process_dict.c b/erts/emulator/beam/erl_process_dict.c index 84cd81aecf..36d16f7f42 100644 --- a/erts/emulator/beam/erl_process_dict.c +++ b/erts/emulator/beam/erl_process_dict.c @@ -749,7 +749,7 @@ static void shrink(Process *p, Eterm* ret) if (lo == NIL) { ARRAY_PUT(pd, pd->splitPosition, hi); } else { - int needed = 4; + Sint needed = 4; if (is_list(hi) && is_list(lo)) { needed = 2*erts_list_length(hi); } @@ -814,7 +814,7 @@ static void grow(Process *p) Eterm *hp; unsigned int pos; unsigned int homeSize; - int needed = 0; + Sint needed = 0; ProcDict *pd = p->dictionary; #ifdef DEBUG Eterm *hp_limit; |