mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 17:14:12 +08:00
mdbx: assert for NODEPTR.
This commit is contained in:
parent
febe2e2748
commit
daa08e6102
6
mdbx.c
6
mdbx.c
@ -763,7 +763,11 @@ typedef struct MDB_node {
|
|||||||
#define LEAFSIZE(k, d) (NODESIZE + (k)->mv_size + (d)->mv_size)
|
#define LEAFSIZE(k, d) (NODESIZE + (k)->mv_size + (d)->mv_size)
|
||||||
|
|
||||||
/** Address of node \b i in page \b p */
|
/** Address of node \b i in page \b p */
|
||||||
#define NODEPTR(p, i) ((MDB_node *)((char *)(p) + (p)->mp_ptrs[i] + PAGEBASE))
|
#define NODEPTR(p, i) \
|
||||||
|
({ \
|
||||||
|
assert(NUMKEYS(p) > (unsigned)(i)); \
|
||||||
|
(MDB_node *)((char *)(p) + (p)->mp_ptrs[i] + PAGEBASE); \
|
||||||
|
})
|
||||||
|
|
||||||
/** Address of the key for the node */
|
/** Address of the key for the node */
|
||||||
#define NODEKEY(node) (void *)((node)->mn_data)
|
#define NODEKEY(node) (void *)((node)->mn_data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user