Skip to content

Commit

Permalink
Improve assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
P-p-H-d committed Nov 10, 2018
1 parent 16587ae commit a8b5c3f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion m-bptree.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,10 @@
for(int i2 = 1; i2 < num2 ; i2++) { \
assert (M_CALL_CMP(key_oplist, (node)->key[i2-1], (node)->key[i2]) < 0); \
} \
if ((node)->next != NULL) \
if ((node)->next != NULL) { \
assert (num2 >= 1); \
assert (M_CALL_CMP(key_oplist, (node)->key[num2-1], (node)->next->key[0]) < 0); \
} \
} while (0)
#endif

Expand Down Expand Up @@ -325,6 +327,7 @@
,) \
} else { \
for(int i = 0; i <= num; i++) { \
assert(o->kind.node[i] != root); \
n->kind.node[i] = M_C(name, _copy_node)(o->kind.node[i], root); \
} \
for(int i = 0; i < num; i++) { \
Expand Down

0 comments on commit a8b5c3f

Please sign in to comment.