adds (disabled) road stack-overflow check to jam and nock

This commit is contained in:
Joe Bryan 2019-08-05 13:08:21 -07:00
parent e03c9286aa
commit e8e5b60513
2 changed files with 34 additions and 1 deletions

View File

@ -138,8 +138,25 @@ _jam_buf_atom(_jam_buf* buf_u, u3_noun a)
else {
_jam_buf_chop(&buf_u, 2, 1);
*top = u3t(a);
u3R->cap_p += mov;
// XX disabled for performance
// may be unnecessary, u3h_put calls u3r_mug,
// which uses and checks the stack
//
#if 0
if ( 0 == off ) {
if( !(u3R->cap_p > u3R->hat_p) ) {
u3m_bail(c3__meme);
}
}
else {
if( !(u3R->cap_p < u3R->hat_p) ) {
u3m_bail(c3__meme);
}
}
#endif
top = u3to(u3_noun, u3R->cap_p + off);
*top = u3h(a);
}

View File

@ -1345,6 +1345,22 @@ static inline void
_n_push(c3_ys mov, c3_ys off, u3_noun a)
{
u3R->cap_p += mov;
// XX stack sanity-check disabled for performance
//
#if 0
if ( 0 == off ) {
if( !(u3R->cap_p > u3R->hat_p) ) {
u3m_bail(c3__meme);
}
}
else {
if( !(u3R->cap_p < u3R->hat_p) ) {
u3m_bail(c3__meme);
}
}
#endif
u3_noun* p = u3to(u3_noun, u3R->cap_p + off);
*p = a;
}