diff options
| author | gingerBill <bill@gingerbill.org> | 2024-01-05 13:38:30 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-01-05 13:38:30 +0000 |
| commit | 2820bbc269bb989052163544f2764bc4287254e4 (patch) | |
| tree | b150a2af61c79dca0202609d37a8637084776df0 /src/check_expr.cpp | |
| parent | 70c5153471433bea6f3081ea3189613a02f54c6a (diff) | |
Add `@(entry_point_only)` for procedures
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 71accfb81..14e3bc0de 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -7195,6 +7195,14 @@ gb_internal ExprKind check_call_expr(CheckerContext *c, Operand *operand, Ast *c } } add_entity_use(c, operand->expr, initial_entity); + + if (initial_entity->Procedure.entry_point_only) { + if (c->curr_proc_decl && c->curr_proc_decl->entity == c->info->entry_point) { + // Okay + } else { + error(operand->expr, "Procedures with the attribute '@(entry_point_only)' can only be called directly from the user-level entry point procedure"); + } + } } if (operand->mode != Addressing_ProcGroup) { |