From: Jérémie Astor Date: Wed, 22 Sep 2021 17:27:49 +0000 (+0200) Subject: :bug: More edge case fixes X-Git-Tag: nightly~429 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=c9ac36b888aa9f8a3597d4fe79d99bc94e8a80a7;p=gwion.git :bug: More edge case fixes --- diff --git a/src/lib/object_op.c b/src/lib/object_op.c index e2353320..6a50adb5 100644 --- a/src/lib/object_op.c +++ b/src/lib/object_op.c @@ -144,8 +144,14 @@ ANN static void emit_member_func(const Emitter emit, const Exp_Dot *member) { if (!vflag(f->value_ref, vflag_member)) instr->m_val2 = -SZ_INT; else { - const Instr instr = emit_add_instr(emit, RegMove); - instr->m_val = SZ_INT; + if(member->is_call){ + const Instr instr = emit_add_instr(emit, RegMove); + instr->m_val = SZ_INT; + } else { + const Instr instr = (Instr)vector_back(&emit->code->instr); + instr->opcode = eRegPushImm; + instr->m_val = (m_uint)f->code; + } } } return; diff --git a/src/parse/template.c b/src/parse/template.c index 9419af4b..80e76556 100644 --- a/src/parse/template.c +++ b/src/parse/template.c @@ -18,7 +18,7 @@ ANN static m_bool _push_types(const Env env, const Nspc nspc, Type_List call = tmpl->call; do { if (!call) break; - const Type t = known_type(env, call->td); + const Type t = call->td ? known_type(env, call->td) : NULL; if (!t) return GW_OK; nspc_add_type(nspc, list->xid, t); call = call->next; diff --git a/src/vm/vm.c b/src/vm/vm.c index 8cbc14d3..96ba7e92 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -684,7 +684,7 @@ vm_run(const VM *vm) { // lgtm [cpp/use-of-goto] intlt: INT_LOGICAL(<) intle: - INT_IMM_LOGICAL(<=) + INT_LOGICAL(<=) intgtimm: INT_IMM_LOGICAL(>) intgeimm: