From d90712708a176ce052cd5bfe434fb350bc306f00 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 7 Jan 2026 18:19:55 -0500 Subject: [PATCH] xo-arena: verify SM4.2 in DArenaHashMap.verify_ok --- include/xo/arena/DArenaHashMap.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/xo/arena/DArenaHashMap.hpp b/include/xo/arena/DArenaHashMap.hpp index 7e03a1e..c003dc0 100644 --- a/include/xo/arena/DArenaHashMap.hpp +++ b/include/xo/arena/DArenaHashMap.hpp @@ -550,6 +550,19 @@ namespace xo { } } + /* SM4.2: if control_[i] is empty or tombstone, slots_[i].first = key_type() */ + for (size_type i = 0; i < n_slot_; ++i) { + uint8_t c = control_[i]; + if ((c == c_empty_slot) || (c == c_tombstone)) { + if (!(slots_[i].first == key_type())) { + return policy.report_error(log, + c_self, ": expect empty/tombstone slot has default key", + xtag("i", i), + xtag("control[i]", c)); + } + } + } + return true; } }