mirror of
https://github.com/odin-lang/Odin.git
synced 2026-10-06 04:42:15 -04:00
Fix poly proc determination by cloning the signature node
This commit is contained in:
1 parent
c2f9bf489e
commit
9b063ad9a3
3 files changed
+23
-21
No files matched your search
+3
-3
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user