replaces road stack sanity assertions with explicit bail:meme

This commit is contained in:
Joe Bryan 2019-08-05 13:07:41 -07:00
parent ab562348e9
commit e03c9286aa
3 changed files with 26 additions and 8 deletions

View File

@ -38,10 +38,14 @@ _cue_push(c3_ys mov,
// (off==0 means we're on a north road)
//
if ( 0 == off ) {
c3_assert(u3R->cap_p > u3R->hat_p);
if( !(u3R->cap_p > u3R->hat_p) ) {
u3m_bail(c3__meme);
}
}
else {
c3_assert(u3R->cap_p < u3R->hat_p);
if( !(u3R->cap_p < u3R->hat_p) ) {
u3m_bail(c3__meme);
}
}
cueframe* fam_u = u3to(cueframe, u3R->cap_p + off);

View File

@ -586,8 +586,13 @@ u3a_push(c3_w len_w)
top -= len_w;
cur = top;
u3p(void) cap_p = u3R->cap_p = u3of(void, top);
c3_assert(cap_p < u3R->mat_p);
c3_assert(cap_p > u3R->hat_p);
if( !( cap_p < u3R->mat_p &&
cap_p > u3R->hat_p ) )
{
u3m_bail(c3__meme);
}
return cur;
}
else {
@ -595,8 +600,13 @@ u3a_push(c3_w len_w)
top += len_w;
u3R->cap_p = u3of(void, top);
u3p(void) cap_p = u3R->cap_p = u3of(void, top);
c3_assert(cap_p > u3R->mat_p);
c3_assert(cap_p < u3R->hat_p);
if( !( cap_p > u3R->mat_p &&
cap_p < u3R->hat_p ) )
{
u3m_bail(c3__meme);
}
return cur;
}
}

View File

@ -1597,10 +1597,14 @@ _mug_push(c3_ys mov,
// (off==0 means we're on a north road)
//
if ( 0 == off ) {
c3_assert(u3R->cap_p > u3R->hat_p);
if( !(u3R->cap_p > u3R->hat_p) ) {
u3m_bail(c3__meme);
}
}
else {
c3_assert(u3R->cap_p < u3R->hat_p);
if( !(u3R->cap_p < u3R->hat_p) ) {
u3m_bail(c3__meme);
}
}
mugframe* fam_u = u3to(mugframe, u3R->cap_p + off);