diff options
| author | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2025-06-10 06:13:14 -0400 |
|---|---|---|
| committer | Feoramund <161657516+Feoramund@users.noreply.github.com> | 2025-06-10 06:13:14 -0400 |
| commit | 5ed2735658c4ae1ad9aa5d790a6ebd64136bdf27 (patch) | |
| tree | 0c5d372740caa882d597353ae652a36d07d01bc9 /src | |
| parent | d08e14fc3c62511e31e08284f832531deb2f4beb (diff) | |
Guard against invalid proc types in parameter list
Fixes #4362
Diffstat (limited to 'src')
| -rw-r--r-- | src/check_expr.cpp | 5 |
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); |