diff options
author | Lukas Larsson <lukas@erlang.org> | 2022-04-28 16:23:19 +0200 |
---|---|---|
committer | Lukas Larsson <lukas@erlang.org> | 2022-04-30 13:48:41 +0200 |
commit | 864cfc571caa17dcbedfd97047a4a94a731d5304 (patch) | |
tree | 3358fde108f62404c8138d7d7d920e9eecb97f8f | |
parent | 2cc59afc737d0e72a314f5bd299f2b4052e13b99 (diff) | |
download | erlang-864cfc571caa17dcbedfd97047a4a94a731d5304.tar.gz |
erts: Fix faulty alloc assert on 32-bit
The total block size can be > 2 GB, so the ASSERT would trigger
on working code. So we only check the blocks size on 64-bit
systems.
-rw-r--r-- | erts/emulator/beam/erl_alloc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_alloc.c b/erts/emulator/beam/erl_alloc.c index 40608aae86..f818779e45 100644 --- a/erts/emulator/beam/erl_alloc.c +++ b/erts/emulator/beam/erl_alloc.c @@ -2081,7 +2081,8 @@ alcu_size(ErtsAlcType_t alloc_no, ErtsAlcUFixInfo_t *fi, int fisz) erts_alcu_foreign_size(allctr, alloc_no, &size); } - ASSERT(((SWord)size.blocks) >= 0); + /* Sanity check of block size on 64-bit */ + ASSERT(sizeof(UWord) == 4 || ((SWord)size.blocks) >= 0); res += size.blocks; } |