From 95235836fde53f06eb15f88565bca996b81a09b1 Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Mon, 13 Jun 2022 21:01:22 +0200 Subject: [PATCH] Fix function argument ordering --- base.kl | 9 ++++++++- typechecking.cpp | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/base.kl b/base.kl index 8f8fc78..daccb04 100644 --- a/base.kl +++ b/base.kl @@ -26,7 +26,12 @@ align_up :: (size: SizeU, align: SizeU): SizeU reserve :: (size: SizeU): OS_Memory result := OS_Memory{reserve=align_up(size, OS_PAGE_SIZE)} - result.data = VirtualAlloc(0, result.reserve, MEM_RESERVE, PAGE_READWRITE)->*U8 + result.data = VirtualAlloc( + flProtect = PAGE_READWRITE, + dwSize = result.reserve, + flAllocationType = MEM_RESERVE, + lpAddress = 0, + )->*U8 return result clamp_top_sizeu :: (val: SizeU, max: SizeU): SizeU @@ -45,3 +50,5 @@ commit :: (m: *OS_Memory, size: SizeU): Bool return true return false +entry :: () + memory := reserve(size = 10000) diff --git a/typechecking.cpp b/typechecking.cpp index c0b14cf..313a9e8 100644 --- a/typechecking.cpp +++ b/typechecking.cpp @@ -884,6 +884,8 @@ resolve_expr(Ast_Expr *ast, Resolve_Flag flags, Ast_Type *compound_context){ } + node->exprs = items.tight_copy(pctx->perm); + // @note: check if all arguments are included and cleanup For(node->exprs){ if(!is_flag_set(it->flags, AST_ITEM_INCLUDED))