From 4438b436c40e31c9964ff7b8b9d57c1a99c89065 Mon Sep 17 00:00:00 2001 From: Daniel Poetzl Date: Mon, 2 Jul 2018 14:52:05 +0100 Subject: [PATCH] Fix sharing map internal assertion --- src/util/sharing_node.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/sharing_node.h b/src/util/sharing_node.h index 11c3493cec..09598506e7 100644 --- a/src/util/sharing_node.h +++ b/src/util/sharing_node.h @@ -257,8 +257,9 @@ public: leaft *place_leaf(const keyT &k, const valueT &v) { SN_ASSERT(is_container()); - - SN_ASSERT(as_const(this)->find_leaf(k) == nullptr); + // we need to check empty() first as the const version of find_leaf() must + // not be called on an empty node + SN_ASSERT(empty() || as_const(this)->find_leaf(k) == nullptr); leaf_listt &c = get_container(); c.push_front(leaft(k, v));