From 58c49bc5e1bd0787927187dd50d58c18dff1723c Mon Sep 17 00:00:00 2001 From: Edward Amsden Date: Tue, 19 Dec 2023 21:36:27 -0600 Subject: [PATCH] pma: dont assert loidx != in _bt_dirty, it could well be! --- rust/ares_pma/c-src/btree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/ares_pma/c-src/btree.c b/rust/ares_pma/c-src/btree.c index 5400f72..6055f10 100644 --- a/rust/ares_pma/c-src/btree.c +++ b/rust/ares_pma/c-src/btree.c @@ -3031,7 +3031,7 @@ _bt_dirty(BT_state *state, vaof_t lo, vaof_t hi, pgno_t nodepg, { BT_page *node = _node_get(state, nodepg); size_t N = _bt_numkeys(node); - size_t loidx = 0; + size_t loidx = BT_DAT_MAXKEYS; // 0 is a valid loidx! size_t hiidx = 0; /* find loidx of range */ @@ -3042,7 +3042,7 @@ _bt_dirty(BT_state *state, vaof_t lo, vaof_t hi, pgno_t nodepg, break; } } - assert(loidx != 0); + assert(loidx < BT_DAT_MAXKEYS); /* find hiidx (exclusive) of range */ for (size_t i = loidx+1; i < N; i++) {