diff --git a/base_data_structures.cpp b/base_data_structures.cpp index bd53b41..58d9748 100644 --- a/base_data_structures.cpp +++ b/base_data_structures.cpp @@ -474,11 +474,6 @@ void list_free_node(List *list, List_Node *node) { DLL_STACK_ADD(list->first_free, node); } -template -void clear(List *list) { - memory_zero(list, sizeof(List)); -} - template int length(List *list) { int result = 0; diff --git a/core_typechecking.cpp b/core_typechecking.cpp index af00248..15858f6 100644 --- a/core_typechecking.cpp +++ b/core_typechecking.cpp @@ -938,6 +938,7 @@ try_resolving_lambda_scope(Operand *op, Ast_Lambda *lambda, Ast_Type *lambda_typ } *op = operand_lambda(lambda_type); + free_all_nodes(&lambda->scope->decls); } else if (is_flag_set(lambda->flags, AST_FOREIGN)) { *op = operand_lambda(lambda_type); @@ -1709,11 +1710,11 @@ resolve_decl(Ast_Decl *ast) { node->unique_name = node->name; if (!is_flag_set(node->expr->flags, AST_FOREIGN)) { - node->unique_name = pctx->intern(string_fmt(scratch.arena, "%Q%Q%d", pctx->symbol_prefix, node->name, pctx->lambda_ids++)); + node->unique_name = pctx->internf("%Q%Q%d", pctx->symbol_prefix, node->name, pctx->lambda_ids++); } if (is_flag_set(node->flags, AST_OPERATOR_OVERLOAD)) { - node->unique_name = pctx->intern(string_fmt(scratch.arena, "%QOPERATOR_%Q%d", pctx->symbol_prefix, node->overload_op_info->name, pctx->lambda_ids++)); + node->unique_name = pctx->internf("%QOPERATOR_%Q%d", pctx->symbol_prefix, node->overload_op_info->name, pctx->lambda_ids++); } BREAK();