From: Brendan Hansen Date: Thu, 3 Jun 2021 03:16:45 +0000 (-0500) Subject: bugfix with a call node being checked multiple times X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=22a17946c66ff95b843b01bd8ac868c702188a89;p=onyx.git bugfix with a call node being checked multiple times --- diff --git a/bin/onyx b/bin/onyx index 5369eee0..8c7dc830 100755 Binary files a/bin/onyx and b/bin/onyx differ diff --git a/src/onyxchecker.c b/src/onyxchecker.c index 041cace8..c78dc33d 100644 --- a/src/onyxchecker.c +++ b/src/onyxchecker.c @@ -400,8 +400,10 @@ CheckStatus check_call(AstCall* call) { // 8. If callee is an intrinsic, turn call into an Intrinsic_Call node // 9. Check types of formal and actual params against each other, handling varargs + if (call->flags & Ast_Flag_Has_Been_Checked) return Check_Success; + CHECK(expression, &call->callee); - check_arguments(&call->args); + CHECK(arguments, &call->args); // SPEED CLEANUP: Keeping an original copy for basically no reason except that sometimes you // need to know the baked argument values in code generation. @@ -575,6 +577,8 @@ CheckStatus check_call(AstCall* call) { type_checking_done: + call->flags |= Ast_Flag_Has_Been_Checked; + if (arg_pos < callee->type->Function.needed_param_count) { onyx_report_error(call->token->pos, "Too few arguments to function call."); return Check_Error;