From aafad13a7246e81cd5fb10e2d4faafa4850699ce Mon Sep 17 00:00:00 2001 From: lucioleKi Date: Tue, 2 Jul 2024 09:45:18 +0200 Subject: [PATCH] fix size unit in atom_text_alloc --- erts/emulator/beam/atom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/emulator/beam/atom.c b/erts/emulator/beam/atom.c index 1a3153028170..d4efd3577cf9 100644 --- a/erts/emulator/beam/atom.c +++ b/erts/emulator/beam/atom.c @@ -116,6 +116,7 @@ atom_text_alloc(int bytes, Uint* size) } else { bytes = ERL_REFC_BITS_SIZE; } + *size = bytes; bytes *= sizeof(Eterm); if (atom_text_pos + bytes >= atom_text_end) { @@ -124,7 +125,6 @@ atom_text_alloc(int bytes, Uint* size) res = atom_text_pos; atom_text_pos += bytes; atom_space += bytes; - *size = bytes; ASSERT(_is_taggable_pointer(res)); return (Eterm*)res; }