flush pipes in g_pst

This commit is contained in:
dzaima 2022-05-29 16:12:14 +03:00
parent a108ef2ce7
commit 6033c2e90e
2 changed files with 5 additions and 4 deletions

View File

@ -827,7 +827,7 @@ void g_p(B x) { print(x); putchar(10); fflush(stdout); }
void g_i(B x) { B r = info_c2(x, m_f64(1), inc(x)); print(r); dec(r); putchar(10); fflush(stdout); } void g_i(B x) { B r = info_c2(x, m_f64(1), inc(x)); print(r); dec(r); putchar(10); fflush(stdout); }
void g_pv(void* x) { print(tag(x,OBJ_TAG)); putchar(10); fflush(stdout); } void g_pv(void* x) { print(tag(x,OBJ_TAG)); putchar(10); fflush(stdout); }
void g_iv(void* x) { B xo = tag(x, OBJ_TAG); B r = info_c2(xo, m_f64(1), inc(xo)); print(r); dec(r); putchar(10); fflush(stdout); } void g_iv(void* x) { B xo = tag(x, OBJ_TAG); B r = info_c2(xo, m_f64(1), inc(xo)); print(r); dec(r); putchar(10); fflush(stdout); }
void g_pst(void) { vm_pstLive(); } void g_pst(void) { vm_pstLive(); fflush(stdout); fflush(stderr); }
#ifdef DEBUG #ifdef DEBUG
#ifdef OBJ_COUNTER #ifdef OBJ_COUNTER

View File

@ -218,9 +218,10 @@ extern Env* envEnd;
extern u64 envPrevHeight; // envStart+prevEnvHeight gives envCurr+1 from before the error extern u64 envPrevHeight; // envStart+prevEnvHeight gives envCurr+1 from before the error
static inline void pushEnv(Scope* sc, u32* bc) { static inline void pushEnv(Scope* sc, u32* bc) {
if (envCurr+1==envEnd) thrM("Stack overflow"); if (envCurr+1==envEnd) thrM("Stack overflow");
envCurr++; Env* e = envCurr+1;
envCurr->sc = sc; e->sc = sc;
envCurr->pos = (u64)bc; e->pos = (u64)bc;
envCurr = e;
} }
static inline void popEnv() { static inline void popEnv() {
assert(envCurr>=envStart); assert(envCurr>=envStart);