From: fennecdjay Date: Fri, 11 Oct 2019 00:05:32 +0000 (+0200) Subject: :art: Improve spork X-Git-Tag: nightly~2189 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=e35b330940b6e681041bd37bf2d7555fd0ce33c0;p=gwion.git :art: Improve spork --- diff --git a/src/emit/emit.c b/src/emit/emit.c index f15dc145..efd23324 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1064,17 +1064,13 @@ ANN Instr emit_exp_spork(const Emitter emit, const Exp_Unary* unary) { ini->m_val = (m_uint)code; ini->m_val2 = is_spork; if(!f) { - if(!is_spork) { - const Instr push = emit_add_instr(emit, RegPush); - push->m_val = SZ_INT; + if(is_spork) { + const Instr spork = emit_add_instr(emit, SporkExp); + spork->m_val = emit->code->stack_depth; + } else { + const Instr spork = emit_add_instr(emit, ForkEnd); + spork->m_val = exp_self(unary)->emit_var; } -if(is_spork) { - const Instr spork = emit_add_instr(emit, is_spork ? SporkExp : ForkEnd); - spork->m_val = emit->code->stack_depth; -} else { - const Instr spork = emit_add_instr(emit, is_spork ? SporkExp : ForkEnd); - spork->m_val = exp_self(unary)->emit_var; -} } else { if(GET_FLAG(f, member) && is_fptr(emit->gwion, f->value_ref->type)) { const m_uint depth = f->def->stack_depth;