From cd7e4fff323e219a02869a7a843f63316c435f05 Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Tue, 27 Sep 2022 22:56:07 +0200 Subject: [PATCH] Fix bug where you could pass arbitrary number of arguments, bug was due probably to forgetting how the algorithm worked and so very trivial ordering of statements was wrong. --- core_typechecking.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core_typechecking.cpp b/core_typechecking.cpp index b217d81..f0f021d 100644 --- a/core_typechecking.cpp +++ b/core_typechecking.cpp @@ -1353,9 +1353,6 @@ resolve_expr(Ast_Expr *ast, Resolve_Flag flags, Ast_Type *compound_context){ } - node->exprs = items.tight_copy(pctx->perm); - node->resolved_type = name.type->func.ret; - // @note: check if all arguments are included and cleanup For(node->exprs){ if(!is_flag_set(it->call_flags, CALL_INCLUDED)) @@ -1363,6 +1360,9 @@ resolve_expr(Ast_Expr *ast, Resolve_Flag flags, Ast_Type *compound_context){ else unset_flag(it->call_flags, CALL_INCLUDED); } + node->exprs = items.tight_copy(pctx->perm); + node->resolved_type = name.type->func.ret; + return operand_rvalue(name.type->func.ret); //