From: fennecdjay Date: Tue, 9 Jul 2019 17:42:42 +0000 (+0200) Subject: :bug: Fix X-Git-Tag: nightly~2348^2~12 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=70750878c9cfc4f2a8a751d424126958a4ffedf3;p=gwion.git :bug: Fix --- diff --git a/src/parse/check.c b/src/parse/check.c index a3e565eb..b838c40c 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -368,8 +368,7 @@ ANN2(1,2) static Func find_func_match_actual(const Env env, Func func, const Exp return find_func_match_actual(env, func->next, args, implicit, specific); } if(e1->type == t_undefined || -(GET_FLAG(func, template) && isa(actual_type(func->value_ref->type), t_fptr) > 0) -) { + (func->def->base->tmpl && is_fptr(func->value_ref->type) > 0)) { if(func->value_ref->owner_class) CHECK_BO(template_push_types(env, func->value_ref->owner_class->e->def->base.tmpl)) e1->type = known_type(env, e1->td); @@ -381,7 +380,6 @@ ANN2(1,2) static Func find_func_match_actual(const Env env, Func func, const Exp e = e->next; e1 = e1->next; } -printf("end %p %p\n", e1, func); if(!e1) return func; } while((func = func->next)); @@ -587,15 +585,11 @@ ANN static Type check_exp_call_template(const Env env, const Exp_Call *exp) { const Exp call = exp->func; const Exp args = exp->args; m_uint args_number = 0; -puts("here =="); DECL_OO(const Value, value, = nspc_lookup_value1(call->type->e->owner, insert_symbol(call->type->name))) -puts("after here =="); const m_uint type_number = get_type_number(value->d.func_ref->def->base->tmpl->list); -printf("%s func\n", __func__) ; Type_List tl[type_number]; ID_List list = value->d.func_ref->def->base->tmpl->list; while(list) { -printf("%s func\n", __func__) ; Arg_List arg = value->d.func_ref->def->base->args; Exp template_arg = args; while(arg && template_arg) { @@ -715,11 +709,7 @@ ANN static Type check_exp_call(const Env env, Exp_Call* exp) { CHECK_OO((exp->m_func = ret)) return ret->def->base->ret_type; } - - const Type t = check_exp_call1(env, exp); -printf("here exp_call %p\n", t); -return t; -// return check_exp_call1(env, exp); + return check_exp_call1(env, exp); } ANN static Type check_exp_unary(const Env env, const Exp_Unary* unary) { diff --git a/tests/import/test.log b/tests/import/test.log index 8557b3a4..b584940e 100644 --- a/tests/import/test.log +++ b/tests/import/test.log @@ -11398,45 +11398,3 @@ global_func.gw ==22565== Memcheck, a memory error detector ==4349== ==4349== For counts of detected and suppressed errors, rerun with: -v ==4349== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) -/dev/null ==13821== Memcheck, a memory error detector -==13821== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==13821== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==13821== Command: ./../../gwion -p. -d dummy /dev/null -==13821== Parent PID: 13795 -==13821== -==13821== -==13821== HEAP SUMMARY: -==13821== in use at exit: 928 bytes in 10 blocks -==13821== total heap usage: 974 allocs, 964 frees, 7,596,796 bytes allocated -==13821== -==13821== LEAK SUMMARY: -==13821== definitely lost: 928 bytes in 10 blocks -==13821== indirectly lost: 0 bytes in 0 blocks -==13821== possibly lost: 0 bytes in 0 blocks -==13821== still reachable: 0 bytes in 0 blocks -==13821== suppressed: 0 bytes in 0 blocks -==13821== Rerun with --leak-check=full to see details of leaked memory -==13821== -==13821== For counts of detected and suppressed errors, rerun with: -v -==13821== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) -/dev/null ==14729== Memcheck, a memory error detector -==14729== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. -==14729== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info -==14729== Command: ./../../gwion -p. -d dummy /dev/null -==14729== Parent PID: 13795 -==14729== -==14729== -==14729== HEAP SUMMARY: -==14729== in use at exit: 576 bytes in 9 blocks -==14729== total heap usage: 956 allocs, 947 frees, 7,590,612 bytes allocated -==14729== -==14729== LEAK SUMMARY: -==14729== definitely lost: 576 bytes in 9 blocks -==14729== indirectly lost: 0 bytes in 0 blocks -==14729== possibly lost: 0 bytes in 0 blocks -==14729== still reachable: 0 bytes in 0 blocks -==14729== suppressed: 0 bytes in 0 blocks -==14729== Rerun with --leak-check=full to see details of leaked memory -==14729== -==14729== For counts of detected and suppressed errors, rerun with: -v -==14729== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)