From 9c652505c803c202135fcfb9e3e5b8cfabcaf333 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Tue, 26 May 2020 12:10:41 +0200 Subject: [PATCH] :bug: Fix scoped_stmt --- src/emit/emit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/emit/emit.c b/src/emit/emit.c index 20865790..c8a06ac9 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1101,7 +1101,8 @@ static m_bool scoped_stmt(const Emitter emit, const Stmt stmt, const m_bool pop) ++emit->env->scope->depth; emit_push_scope(emit); const Instr gc = emit_add_instr(emit, NoOp); - if(emit_stmt(emit, stmt, pop) > 0) { + const m_bool ret = emit_stmt(emit, stmt, pop); + if(ret > 0) { const m_bool pure = !vector_back(&emit->info->pure); if(!pure) { gc->opcode = eGcIni; @@ -1110,7 +1111,7 @@ static m_bool scoped_stmt(const Emitter emit, const Stmt stmt, const m_bool pop) } emit_pop_scope(emit); --emit->env->scope->depth; - return GW_OK; + return ret; } #define SPORK_FUNC_PREFIX "spork~func:%i" @@ -1968,7 +1969,6 @@ ANN static m_bool emit_func_def(const Emitter emit, const Func_Def f) { const m_bool ret = scanx_fdef(emit->env, emit, fdef, (_exp_func)emit_fdef); emit_pop_scope(emit); emit->env->func = former; - if(ret > 0) emit_fdef_finish(emit, fdef); return ret; -- 2.43.0