From 3943af3d6b9be5127e61ed6376afe808671d0c90 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sat, 13 Jun 2020 14:43:45 +0200 Subject: [PATCH] :bug: Check emit_flow return value --- src/emit/emit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emit/emit.c b/src/emit/emit.c index 7982f68e..e063d3eb 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1264,7 +1264,7 @@ ANN static Instr _flow(const Emitter emit, const Exp e, const m_bool b) { #define emit_flow(emit,b) _flow(emit, b, 1) ANN static m_bool emit_exp_if(const Emitter emit, const Exp_If* exp_if) { - const Instr op = emit_flow(emit, exp_if->cond); + DECL_OB(const Instr, op, = emit_flow(emit, exp_if->cond)) CHECK_BB(emit_exp_pop_next(emit, exp_if->if_exp ?: exp_if->cond)) const Instr op2 = emit_add_instr(emit, Goto); op->m_val = emit_code_size(emit); @@ -1473,7 +1473,7 @@ ANN static m_bool emit_stmt_varloop(const Emitter emit, const Stmt_VarLoop stmt) ANN static m_bool _emit_stmt_for(const Emitter emit, const Stmt_For stmt, m_uint *action_index) { CHECK_BB(emit_stmt(emit, stmt->c1, 1)) const m_uint index = emit_code_size(emit); - const Instr op = emit_flow(emit, stmt->c2->d.stmt_exp.val); + DECL_OB(const Instr, op, = emit_flow(emit, stmt->c2->d.stmt_exp.val)) CHECK_BB(scoped_stmt(emit, stmt->body, 1)) *action_index = emit_code_size(emit); if(stmt->c3) { -- 2.43.0