aboutsummaryrefslogtreecommitdiff
path: root/src/check_builtin.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2025-03-24 11:35:10 +0000
committergingerBill <bill@gingerbill.org>2025-03-24 11:35:10 +0000
commitacb578f184c55f0d1b20ef844a506185684efeba (patch)
tree8790e2d6c03408be0e1f970a80029ad2f6fc0920 /src/check_builtin.cpp
parent2b8c76354d489de199a4b8d98290601e89df0645 (diff)
Fix #4962
Diffstat (limited to 'src/check_builtin.cpp')
-rw-r--r--src/check_builtin.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp
index 023aeff73..a49302a69 100644
--- a/src/check_builtin.cpp
+++ b/src/check_builtin.cpp
@@ -1675,12 +1675,16 @@ gb_internal bool check_builtin_procedure_directive(CheckerContext *c, Operand *o
}
if (ce->args.count > 0) {
Ast *arg = ce->args[0];
- Operand o = {};
- Entity *e = check_ident(c, &o, arg, nullptr, nullptr, true);
- if (e == nullptr || (e->flags & EntityFlag_Param) == 0) {
- error(ce->args[0], "'#caller_expression' expected a valid earlier parameter name");
+ if (arg->kind != Ast_Ident) {
+ error(arg, "'#caller_expression' expected an identifier");
+ } else {
+ Operand o = {};
+ Entity *e = check_ident(c, &o, arg, nullptr, nullptr, true);
+ if (e == nullptr || (e->flags & EntityFlag_Param) == 0) {
+ error(arg, "'#caller_expression' expected a valid earlier parameter name");
+ }
+ arg->Ident.entity = e;
}
- arg->Ident.entity = e;
}
operand->type = t_string;