From: fennecdjay Date: Tue, 20 Dec 2022 11:01:20 +0000 (+0100) Subject: :bug: add a few checks X-Git-Tag: nightly~207^2~34 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=9e81ae2f505aa1e2a8e6aff11566225361acd481;p=gwion.git :bug: add a few checks --- diff --git a/src/emit/emit.c b/src/emit/emit.c index ceba3b50..4b9ac0e0 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -867,7 +867,7 @@ ANN static m_bool emit_prim_locale(const Emitter emit, const Symbol *id) { const M_Object string = new_string(emit->gwion, s_name(*id)); emit_pushimm(emit, (m_uint)string); emit_pushimm(emit, (m_uint)emit->locale->code); - emit_exp_call1(emit, emit->locale, true); + CHECK_BB(emit_exp_call1(emit, emit->locale, true)); emit_regmove(emit, -emit->locale->def->base->ret_type->size); const VM_Code code = finalyze(emit, EOC); const VM_Shred shred = new_vm_shred(emit->gwion->mp, code); @@ -1750,7 +1750,7 @@ ANN m_bool emit_exp_spork(const Emitter emit, const Exp_Unary *unary) { .type = emit->env->class_def, .exp_type = ae_exp_primary }; - emit_exp(emit, &exp); + CHECK_BB(emit_exp(emit, &exp)); offset += SZ_INT; } if(sporker.captures) { @@ -1769,7 +1769,7 @@ ANN m_bool emit_exp_spork(const Emitter emit, const Exp_Unary *unary) { }; if(cap->is_ref) exp_setvar(&exp, true); offset += exp_size(&exp); - emit_exp(emit, &exp); + CHECK_BB(emit_exp(emit, &exp)); // emit_exp_addref(emit, &exp, -exp_size(&exp)); } } @@ -1995,7 +1995,7 @@ ANN static m_bool emit_stmt_code(const Emitter emit, const Stmt_Code stmt) { ANN static m_bool optimize_tail_call(const Emitter emit, const Exp_Call *e) { if (e->args) { - emit_func_args(emit, e); + CHECK_BB(emit_func_args(emit, e)); const Func f = e->func->type->info->func; emit_regmove(emit, -f->def->stack_depth); emit_args(emit, f); diff --git a/src/lib/array.c b/src/lib/array.c index 6d37b159..b812f0cc 100644 --- a/src/lib/array.c +++ b/src/lib/array.c @@ -741,7 +741,7 @@ static OP_CHECK(opck_array_scan) { env->context = base->info->value->from->ctx; const m_uint scope = env_push(env, base->info->value->from->owner_class, base->info->value->from->owner); - (void)scan0_class_def(env, cdef); + CHECK_BN(scan0_class_def(env, cdef)); const Type t = cdef->base.type; if (GET_FLAG(base, abstract) && !tflag(base, tflag_union)) SET_FLAG(t, abstract);