mdbx: backport - fix assertions.

Change-Id: I95c43ef1ea2da55a124dc43f03890cf1d96f2e61
This commit is contained in:
Leonid Yuriev 2018-08-10 18:33:59 +03:00
parent d2fcbf5f82
commit 3979ba4784

View File

@ -7828,8 +7828,6 @@ int mdbx_cursor_put(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data,
memcpy(olddata.iov_base, data->iov_base, data->iov_len);
else {
mdbx_cassert(mc, NUMKEYS(mc->mc_pg[mc->mc_top]) == 1);
mdbx_cassert(mc, mc->mc_pg[mc->mc_top]->mp_upper ==
mc->mc_pg[mc->mc_top]->mp_lower);
mdbx_cassert(mc, IS_LEAF(mc->mc_pg[mc->mc_top]) &&
!IS_LEAF2(mc->mc_pg[mc->mc_top]));
mdbx_cassert(mc, NODEDSZ(leaf) == 0);
@ -7837,7 +7835,7 @@ int mdbx_cursor_put(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data,
mdbx_cassert(mc, key->iov_len < UINT16_MAX);
leaf->mn_ksize = (uint16_t)key->iov_len;
memcpy(NODEKEY(leaf), key->iov_base, key->iov_len);
assert((char *)NODEDATA(leaf) + NODEDSZ(leaf) <
assert((char *)NODEKEY(leaf) + NODEDSZ(leaf) <
(char *)(mc->mc_pg[mc->mc_top]) + env->me_psize);
goto fix_parent;
}