u3: use clearer assertions for loom corruption
@@ -119,17 +119,23 @@ _box_detach(u3a_box* box_u)
_box_count(-(box_u->siz_w));
if ( nex_p ) {
- c3_assert(u3to(u3a_fbox, nex_p)->pre_p == fre_p);
+ if ( u3to(u3a_fbox, nex_p)->pre_p != fre_p ) {
+ c3_assert(!"loom: corrupt");
+ }
u3to(u3a_fbox, nex_p)->pre_p = pre_p;
}
if ( pre_p ) {
- c3_assert(u3to(u3a_fbox, pre_p)->nex_p == fre_p);
+ if( u3to(u3a_fbox, pre_p)->nex_p != fre_p ) {
+ c3_assert(!"loom: corrupt");
+ }
u3to(u3a_fbox, pre_p)->nex_p = nex_p;
}
else {
c3_w sel_w = _box_slot(box_u->siz_w);
- c3_assert(fre_p == u3R->all.fre_p[sel_w]);
+ if ( fre_p != u3R->all.fre_p[sel_w] ) {
+ c3_assert(!"loom: corrupt");
+ }
u3R->all.fre_p[sel_w] = nex_p;
}
}
@@ -468,14 +474,18 @@ _ca_willoc(c3_w len_w, c3_w ald_w, c3_w alp_w)
siz_w += pad_w;
_box_count(-(box_u->siz_w));
{
- {
- c3_assert((0 == u3to(u3a_fbox, *pfr_p)->pre_p) ||
+ if ( (0 != u3to(u3a_fbox, *pfr_p)->pre_p) &&
(u3to(u3a_fbox, u3to(u3a_fbox, *pfr_p)->pre_p)->nex_p
- == (*pfr_p)));
+ != (*pfr_p)) )
+ {
+ c3_assert(!"loom: corrupt");
+ }
- c3_assert((0 == u3to(u3a_fbox, *pfr_p)->nex_p) ||
+ if( (0 != u3to(u3a_fbox, *pfr_p)->nex_p) &&
(u3to(u3a_fbox, u3to(u3a_fbox, *pfr_p)->nex_p)->pre_p
- == (*pfr_p)));
+ != (*pfr_p)) )
+ {
+ c3_assert(!"loom: corrupt");
}
if ( 0 != u3to(u3a_fbox, *pfr_p)->nex_p ) {
