From 54860b8ae6840913f4bf8c9faae0218a9a8511e1 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 10 Sep 2019 22:47:39 +0200 Subject: [PATCH] :bug: Fix ret_tmpl --- src/emit/emit.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; } -- 2.43.0