From: fennecdjay Date: Sun, 3 Nov 2019 22:08:53 +0000 (+0100) Subject: :art: Few fixes X-Git-Tag: nightly~2116^2~15 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=4f722fb09cf602a9d496c19d5214384753862a55;p=gwion.git :art: Few fixes --- diff --git a/src/emit/emit.c b/src/emit/emit.c index ec776795..d679478a 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -341,8 +341,12 @@ ANN static m_bool emit_symbol_owned(const Emitter emit, const Exp_Primary* prim) ANN static m_bool emit_symbol_builtin(const Emitter emit, const Exp_Primary* prim) { const Value v = prim->value; - if(GET_FLAG(v, func)) +/* + if(GET_FLAG(v, func)) { regpushi(emit, (m_uint)v->d.func_ref->def->d.dl_func_ptr); + return GW_OK; + } +*/ if(GET_FLAG(v, union)) { const m_uint size = v->type->size; const Instr instr = emit_kind(emit, size, exp_self(prim)->emit_var, dotstatic); diff --git a/src/import/func.c b/src/import/func.c index 03bfe690..ab21b7e6 100644 --- a/src/import/func.c +++ b/src/import/func.c @@ -38,18 +38,22 @@ ANN Arg_List make_dll_arg_list(const Vector v) { for(m_uint i = 1; i < vector_size(v); ++i) arg_list = (arg_list->next = (Arg_List)vector_at(v, i)); vector_release(v); + v->ptr = NULL; return base; } -ANEW ANN static Func_Base* gwi_func_base(const Gwi gwi, const ImportCK *ck) { +ANEW ANN static Func_Base* gwi_func_base(const Gwi gwi, ImportCK *ck) { const Arg_List arg_list = make_dll_arg_list(&gwi->ck->v); Func_Base *base = new_func_base(gwi->gwion->mp, ck->td, ck->sym, arg_list); - if(ck->tmpl) + ck->td = NULL; + if(ck->tmpl) { base->tmpl = new_tmpl(gwi->gwion->mp, ck->tmpl, -1); + ck->tmpl = NULL; + } return base; } -ANN static Func_Def import_fdef(const Gwi gwi, const ImportCK *ck) { +ANN static Func_Def import_fdef(const Gwi gwi, ImportCK *ck) { Func_Base* base = gwi_func_base(gwi, ck); const Func_Def fdef = new_func_def(gwi->gwion->mp, base, NULL, ck->flag | ae_flag_builtin, loc(gwi)); @@ -72,7 +76,7 @@ ANN static m_bool error_fdef(const Gwi gwi, const Func_Def fdef) { return GW_ERROR; } -ANN m_int gwi_func_valid(const Gwi gwi, const ImportCK *ck) { +ANN m_int gwi_func_valid(const Gwi gwi, ImportCK *ck) { DECL_OB(Func_Def, fdef, = import_fdef(gwi, ck)) if(SAFE_FLAG(gwi->gwion->env->class_def, template)) /*return*/ section_fdef(gwi, fdef); diff --git a/src/vm/vm.c b/src/vm/vm.c index a4fc9d52..6f03245f 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -757,7 +757,6 @@ allocmemberaddr: reg += SZ_INT; DISPATCH() dotmember: -//printf("VAL %lu %p\n", VAL, ); *(m_uint*)(reg-SZ_INT) = *(m_uint*)(a.obj->data + VAL); DISPATCH() dotfloat: