diff options
| author | gingerBill <bill@gingerbill.org> | 2018-11-25 17:57:49 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-11-25 17:57:49 +0000 |
| commit | 9b063ad9a3a3b4da52ac4d60c65a0ff7c8dd79cf (patch) | |
| tree | 0ebe8ee21e649e711a1c1d0a47f488790f6c38de /src/check_expr.cpp | |
| parent | c2f9bf489eb3ae7296cf1d255ab2da1037b005b4 (diff) | |
Fix poly proc determination by cloning the signature node
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 47b741f40..28271efb8 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -278,7 +278,6 @@ bool find_or_generate_polymorphic_procedure(CheckerContext *c, Entity *base_enti return false; } - auto *found_gen_procs = map_get(&nctx.info->gen_procs, hash_pointer(base_entity->identifier)); if (found_gen_procs) { auto procs = *found_gen_procs; @@ -304,13 +303,14 @@ bool find_or_generate_polymorphic_procedure(CheckerContext *c, Entity *base_enti // NOTE(bill): Reset scope from the failed procedure type scope_reset(scope); - success = check_procedure_type(&nctx, final_proc_type, pt->node, &operands); + // LEAK TODO(bill): Cloning this AST may be leaky + Ast *cloned_proc_type_node = clone_ast(pt->node); + success = check_procedure_type(&nctx, final_proc_type, cloned_proc_type_node, &operands); if (!success) { return false; } - if (found_gen_procs) { auto procs = *found_gen_procs; for_array(i, procs) { |