]> Nishi Git Mirror - gwion.git/commitdiff
:bug: Fix ret_tmpl
authorfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 10 Sep 2019 20:47:39 +0000 (22:47 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 10 Sep 2019 20:47:39 +0000 (22:47 +0200)
src/emit/emit.c

index eb0de8e0026902d80bd8e5fae3944e4f446b5b52..292d4f91a684c7da9d02162632378cf4299d9a58 100644 (file)
@@ -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;
 }