aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-06-10 17:15:13 +0100
committerGitHub <noreply@github.com>2025-06-10 17:15:13 +0100
commit2a292b588acc0c6b6b79376b727e40bfa217127a (patch)
tree35b2cee60172bf684c70b293a302a24f5e462c3a /src
parentca654440070695e1b98e004e64e1b043c55994b3 (diff)
parent5ed2735658c4ae1ad9aa5d790a6ebd64136bdf27 (diff)
Merge pull request #5305 from Feoramund/fix-4362
Guard against invalid proc types in parameter list
Diffstat (limited to 'src')
-rw-r--r--src/check_expr.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 9308eab8e..335b82f1a 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -6497,7 +6497,7 @@ gb_internal Entity **populate_proc_parameter_list(CheckerContext *c, Type *proc_
Entity **lhs = nullptr;
isize lhs_count = -1;
- if (proc_type == nullptr) {
+ if (proc_type == nullptr || proc_type == t_invalid) {
return nullptr;
}
@@ -6697,6 +6697,9 @@ gb_internal bool check_call_arguments_single(CheckerContext *c, Ast *call, Opera
GB_ASSERT(proc_type != nullptr);
proc_type = base_type(proc_type);
+ if (proc_type == t_invalid) {
+ return false;
+ }
GB_ASSERT(proc_type->kind == Type_Proc);
CallArgumentError err = check_call_arguments_internal(c, call, e, proc_type, positional_operands, named_operands, show_error_mode, data);