Skip to content

Commit 42ccf02

Browse files
committed
Fix sharing map internal assertion
1 parent 14b0392 commit 42ccf02

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/util/sharing_node.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,9 @@ SN_TYPE_PAR_DEF class sharing_node_innert : public sharing_node_baset
257257
leaft *place_leaf(const keyT &k, const valueT &v)
258258
{
259259
SN_ASSERT(is_container());
260-
261-
SN_ASSERT(as_const(this)->find_leaf(k) == nullptr);
260+
// we need to check empty() first as the const version of find_leaf() must
261+
// not be called on an empty node
262+
SN_ASSERT(empty() || as_const(this)->find_leaf(k) == nullptr);
262263

263264
leaf_listt &c = get_container();
264265
c.push_front(leaft(k, v));

0 commit comments

Comments
 (0)