]> Nishi Git Mirror - gwion.git/commitdiff
:bug: Fix use of func_symbol
authorfennecdjay <astor.jeremie@wanadoo.fr>
Thu, 20 Dec 2018 12:40:30 +0000 (13:40 +0100)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Thu, 20 Dec 2018 12:40:30 +0000 (13:40 +0100)
src/lib/func.c
src/parse/check.c
src/parse/scan2.c

index e23b0f119304686a6f349affd41a85d4316ae927..e76315d8c651865af4072082162de60301c22668 100644 (file)
@@ -35,7 +35,7 @@ ANN static Type fptr_type(Exp_Binary* bin) {
   const m_str c = s_name(l_func->def->name);
   const Value v = l_func->value_ref;
   for(m_uint i = 0; i <= v->offset; ++i) {
-    const Symbol sym = func_symbol(nspc, c, NULL, i);
+    const Symbol sym = func_symbol(nspc->name, c, NULL, i);
     const Func f = nspc_lookup_func1(nspc, sym); // was lookup2
     CHECK_OO(f)
     if(compat_func(r_func->def, f->def) > 0) {
index 7b6898c6ebbffa846ccd380c4c328bf7f35daaae..699455e83e58931a02e9b043a8568ea1c8b82e34 100644 (file)
@@ -371,7 +371,7 @@ ANN static m_bool check_call(const Env env, const Exp_Call* exp) {
 }
 
 ANN static inline Value template_get_ready(const Value v, const m_str tmpl, const m_uint i) {
-  const Symbol sym = func_symbol(v->owner, v->name, tmpl, i);
+  const Symbol sym = func_symbol(v->owner->name, v->name, tmpl, i);
   return v->owner_class ? find_value(v->owner_class, sym) :
       nspc_lookup_value1(v->owner, sym);
 }
@@ -995,7 +995,7 @@ ANN static m_bool check_func_args(const Env env, Arg_List arg_list) { GWDEBUG_EX
 }
 
 ANN static inline Func get_overload(const Env env, const Func_Def def, const m_uint i) {
-  const Symbol sym = func_symbol(env->curr, s_name(def->name), NULL, i);
+  const Symbol sym = func_symbol(env->curr->name, s_name(def->name), NULL, i);
   return nspc_lookup_func1(env->curr, sym); // was lookup2
 }
 
index f9055e1de0b5d1c6b44cb80cbff980ed14e52805..9af4b9eb7e50c9a2d355133439fd49385d74edee 100644 (file)
@@ -360,7 +360,7 @@ ANN2(1, 2) static m_bool scan2_func_def_template (const Env env, const Func_Def
   const Value value = func_value(env, func, overload);
   SET_FLAG(value, checked | ae_flag_template);
   SET_FLAG(value->type, func); // the only types with func flag, name could be better
-  const Symbol sym = func_symbol(env->curr, func_name, "template", overload ? ++overload->offset : 0);
+  const Symbol sym = func_symbol(env->curr->name, func_name, "template", overload ? ++overload->offset : 0);
   nspc_add_value(env->curr, sym, value);
   return GW_OK;
 }
@@ -432,7 +432,7 @@ ANN static m_str func_tmpl_name(const Env env, const Func_Def f) {
   }
   tmpl_name[tlen+1] = '\0';
   vector_release(&v);
-  const Symbol sym = func_symbol(env->curr, func_name, tmpl_name, (m_uint)f->tmpl->base);
+  const Symbol sym = func_symbol(env->curr->name, func_name, tmpl_name, (m_uint)f->tmpl->base);
   return s_name(sym);
 }
 
@@ -463,7 +463,7 @@ ANN m_bool scan2_func_def(const Env env, const Func_Def f) { GWDEBUG_EXE
   if(tmpl_list_base(f->tmpl))
     return scan2_func_def_template(env, f, overload);
   if(!f->tmpl) {
-    const Symbol sym  = func_symbol(env->curr, func_name, NULL, overload ? ++overload->offset : 0);
+    const Symbol sym  = func_symbol(env->curr->name, func_name, NULL, overload ? ++overload->offset : 0);
     func_name = s_name(sym);
   } else {
     func_name = func_tmpl_name(env, f);