From f963a23ae97bcd00f028d586d1661a53806208a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Tue, 26 May 2020 02:53:15 +0200 Subject: [PATCH] :bug: Fix non emitted static func --- src/emit/emit.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/emit/emit.c b/src/emit/emit.c index 4938106f..20865790 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1064,6 +1064,13 @@ ANN Instr emit_exp_call1(const Emitter emit, const Func f) { const Instr instr = emit_add_instr(emit, (f_instr)(m_uint)exec); instr->m_val = val; instr->m_val2 = val2; + } else if(f->value_ref->from->owner_class && f != emit->env->func && !f->code&& ! is_fptr(emit->gwion, f->value_ref->type)){ + /* not yet emitted static func */ + const Instr instr = (Instr)vector_back(&emit->code->instr); + assert(instr->opcode == ePushStaticCode); + instr->opcode = eRegPushImm; + const Instr pushcode = emit_add_instr(emit, PushStaticCode); + pushcode->m_val = (m_uint)f; } const m_uint offset = emit_code_offset(emit); regseti(emit, offset); -- 2.43.0