From: fennecdjay Date: Tue, 8 Oct 2019 14:13:33 +0000 (+0200) Subject: :art: Internal gack X-Git-Tag: nightly~2198^2~93 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=1759a68a4cb878278ff52af67f9e7c7f96866aea;p=gwion.git :art: Internal gack --- diff --git a/src/emit/emit.c b/src/emit/emit.c index f2cba9f8..9d2aaf15 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1767,8 +1767,10 @@ ANN static VM_Code emit_internal(const Emitter emit, const Func f) { emit->env->class_def->nspc->dtor = f->code = finalyze(emit, DTOR_EOC); ADD_REF(f->code) return f->code; - } else if(f->def->base->xid == insert_symbol("@gack")) - emit->env->class_def->e->gack = f->code; + } else if(f->def->base->xid == insert_symbol("@gack")) { + f->code = finalyze(emit, FuncReturn); + return emit->env->class_def->e->gack = f->code; + } return finalyze(emit, FuncReturn); } diff --git a/tests/internal_op/internal_gack.gw b/tests/internal_op/internal_gack.gw new file mode 100644 index 00000000..40f8fecb --- /dev/null +++ b/tests/internal_op/internal_gack.gw @@ -0,0 +1,5 @@ +class C { + operator @gack void() { <<< __func__ >>>; } +} +<<< C c >>>; +<<< c >>>;