From: Brendan Hansen Date: Sun, 4 Feb 2024 22:08:34 +0000 (-0600) Subject: fixed: missing clone that could leading to big problems X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=353bb0b56064410867814291a3ccf8dfe0a77620;p=onyx.git fixed: missing clone that could leading to big problems --- diff --git a/compiler/src/checker.c b/compiler/src/checker.c index fd3d9206..b4d7ea9b 100644 --- a/compiler/src/checker.c +++ b/compiler/src/checker.c @@ -1,5 +1,6 @@ #include "astnodes.h" #include "types.h" +#undef BH_INTERNAL_ALLOCATOR #define BH_INTERNAL_ALLOCATOR (global_heap_allocator) #define BH_DEBUG #include "parser.h" @@ -3731,7 +3732,7 @@ CheckStatus check_interface_constraint(AstConstraint *constraint) { AstTyped *sentinel = onyx_ast_node_new(context.ast_alloc, sizeof(AstTyped), Ast_Kind_Constraint_Sentinel); sentinel->token = is->name; - sentinel->type_node = is->type; + sentinel->type_node = (AstType *) ast_clone(context.ast_alloc, (AstNode *) is->type); symbol_introduce(constraint->scope, is->name, (AstNode *) sentinel); } diff --git a/compiler/src/parser.c b/compiler/src/parser.c index 922003c0..bd37b449 100644 --- a/compiler/src/parser.c +++ b/compiler/src/parser.c @@ -4,6 +4,7 @@ // and declarations to be introduced into scopes. #include "astnodes.h" +#undef BH_INTERNAL_ALLOCATOR #define BH_INTERNAL_ALLOCATOR (global_heap_allocator) #include "parser.h"