File 1195-erts-Strengthen-literal-tag-assert.patch of Package erlang
From 8324f3e16336df13a29f0df0a141f96f72201958 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lukas=20Backstr=C3=B6m?= <lukas@erlang.org>
Date: Tue, 28 Jan 2025 09:52:32 +0100
Subject: [PATCH 2/3] erts: Strengthen literal tag assert
We assert that if we are in a literal range, the literal tag
should also be set. This will only be true in the debug build,
but as asserts are only active in debug builds that is fine.
---
erts/emulator/beam/global.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h
index c172ac0df5..1118dc162f 100644
--- a/erts/emulator/beam/global.h
+++ b/erts/emulator/beam/global.h
@@ -1564,6 +1564,9 @@ ERTS_GLB_FORCE_INLINE int erts_is_literal(Eterm tptr, Eterm *ptr)
ASSERT(ptr == ptr_val(tptr));
#if defined(ERTS_HAVE_IS_IN_LITERAL_RANGE)
+#ifdef TAG_LITERAL_PTR
+ ASSERT(!erts_is_in_literal_range(ptr) || is_literal_ptr(tptr));
+#endif
return erts_is_in_literal_range(ptr);
#elif defined(TAG_LITERAL_PTR)
return is_literal_ptr(tptr);
--
2.43.0