From 5b6a0080ace982a4304bbd584e60d49614f70ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Backstr=C3=B6m?= Date: Mon, 27 Jan 2025 23:39:40 +0100 Subject: [PATCH] erts: Make sure to tag orig with literal ptr --- erts/emulator/beam/erl_term.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erts/emulator/beam/erl_term.c b/erts/emulator/beam/erl_term.c index 1e96d8abbe3f..02fcd7836db8 100644 --- a/erts/emulator/beam/erl_term.c +++ b/erts/emulator/beam/erl_term.c @@ -47,6 +47,9 @@ erts_set_literal_tag(Eterm *term, Eterm *hp_start, Eterm hsz) break; case TAG_PRIMARY_HEADER: if (header_is_thing(*hp)) { + if (*hp == HEADER_SUB_BITS) { + ((ErlSubBits*)hp)->orig |= TAG_LITERAL_PTR; + } hp += thing_arityval(*hp); } break;