From: Jérémie Astor Date: Sat, 14 Dec 2019 22:12:57 +0000 (+0100) Subject: :art: func naming can fail X-Git-Tag: nightly~1993 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=339848e64c92e2c32fb21a6250eb29cee133d101;p=gwion.git :art: func naming can fail --- diff --git a/src/parse/scan2.c b/src/parse/scan2.c index de18c9c1..fbb76028 100644 --- a/src/parse/scan2.c +++ b/src/parse/scan2.c @@ -457,7 +457,8 @@ ANN static m_str func_tmpl_name(const Env env, const Func_Def f) { vector_init(&v); do { const Type t = nspc_lookup_type0(env->curr, id->xid); - assert(t); + if(!t)return NULL; +// assert(t); vector_add(&v, (vtype)t); tlen += strlen(t->name); } while((id = id->next) && ++tlen); @@ -500,6 +501,7 @@ ANN2(1,2) static m_str func_name(const Env env, const Func_Def f, const Value v) ANN2(1,2) m_bool scan2_fdef_std(const Env env, const Func_Def f, const Value overload) { const m_str name = func_name(env, f, overload ?: NULL); + if(!name)return GW_ERROR; const Func base = f->base->func; if(!base) CHECK_OB(func_create(env, f, overload, name))