From: fennecdjay Date: Tue, 10 Sep 2019 20:47:39 +0000 (+0200) Subject: :bug: Fix ret_tmpl X-Git-Tag: nightly~2224 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=54860b8ae6840913f4bf8c9faae0218a9a8511e1;p=gwion.git :bug: Fix ret_tmpl --- diff --git a/src/emit/emit.c b/src/emit/emit.c index eb0de8e0..292d4f91 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1774,9 +1774,11 @@ ANN static m_bool emit_func_def_body(const Emitter emit, const Func_Def fdef) { } ANN static m_bool tmpl_rettype(const Emitter emit, const Func_Def fdef) { - CHECK_BB(template_push_types(emit->env, fdef->base->tmpl)) + if(fdef->base->tmpl) + CHECK_BB(template_push_types(emit->env, fdef->base->tmpl)) const m_bool ret = emit_cdef(emit, fdef->base->ret_type->e->def); - emit_pop_type(emit); + if(fdef->base->tmpl) + emit_pop_type(emit); return ret; }