diff --git a/src/mdbx.c b/src/mdbx.c index 4382be23..5182c2bf 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -3849,8 +3849,10 @@ static int mdbx_sync_locked(MDBX_env *env, unsigned flags, target = mdbx_meta_ancient(env, meta1, meta2, true); else if (head == meta1) target = mdbx_meta_ancient(env, meta0, meta2, true); - else if (head == meta2) + else { + mdbx_assert(env, head == meta2); target = mdbx_meta_ancient(env, meta0, meta1, true); + } /* LY: step#2 - update meta-page. */ mdbx_debug( @@ -6190,6 +6192,7 @@ static int mdbx_cursor_first(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data) { if (likely(data)) { if (F_ISSET(leaf->mn_flags, F_DUPDATA)) { + mdbx_cassert(mc, mc->mc_xcursor != nullptr); mdbx_xcursor_init1(mc, leaf); rc = mdbx_cursor_first(&mc->mc_xcursor->mx_cursor, data, NULL); if (unlikely(rc)) @@ -6233,6 +6236,7 @@ static int mdbx_cursor_last(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data) { if (likely(data)) { if (F_ISSET(leaf->mn_flags, F_DUPDATA)) { + mdbx_cassert(mc, mc->mc_xcursor != nullptr); mdbx_xcursor_init1(mc, leaf); rc = mdbx_cursor_last(&mc->mc_xcursor->mx_cursor, data, NULL); if (unlikely(rc)) diff --git a/src/osal.c b/src/osal.c index 08ae9fef..ae28d191 100644 --- a/src/osal.c +++ b/src/osal.c @@ -549,7 +549,7 @@ int mdbx_write(mdbx_filehandle_t fd, const void *buf, size_t bytes) { sigset_t set, old; sigemptyset(&set); sigaddset(&set, SIGPIPE); - int rc = rc = pthread_sigmask(SIG_BLOCK, &set, &old); + int rc = pthread_sigmask(SIG_BLOCK, &set, &old); if (rc != 0) return rc; #endif