bugfix with a call node being checked multiple times
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 3 Jun 2021 03:16:45 +0000 (22:16 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 3 Jun 2021 03:16:45 +0000 (22:16 -0500)
bin/onyx
src/onyxchecker.c

index 5369eee0cf0636f33b3ef2fe28a9a29be9dad1cb..8c7dc83053608610e844951eb4596635c3013ee9 100755 (executable)
Binary files a/bin/onyx and b/bin/onyx differ
index 041cace80f7e7a5da2b76f66d41978b582aafe2a..c78dc33d78445e9b0c724ce682e6d8c48dfc45a9 100644 (file)
@@ -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;