This commit is contained in:
gingerBill
2025-03-24 11:35:10 +00:00
parent 2b8c76354d
commit acb578f184
+5 -1
View File
@@ -1675,13 +1675,17 @@ gb_internal bool check_builtin_procedure_directive(CheckerContext *c, Operand *o
} }
if (ce->args.count > 0) { if (ce->args.count > 0) {
Ast *arg = ce->args[0]; Ast *arg = ce->args[0];
if (arg->kind != Ast_Ident) {
error(arg, "'#caller_expression' expected an identifier");
} else {
Operand o = {}; Operand o = {};
Entity *e = check_ident(c, &o, arg, nullptr, nullptr, true); Entity *e = check_ident(c, &o, arg, nullptr, nullptr, true);
if (e == nullptr || (e->flags & EntityFlag_Param) == 0) { if (e == nullptr || (e->flags & EntityFlag_Param) == 0) {
error(ce->args[0], "'#caller_expression' expected a valid earlier parameter name"); error(arg, "'#caller_expression' expected a valid earlier parameter name");
} }
arg->Ident.entity = e; arg->Ident.entity = e;
} }
}
operand->type = t_string; operand->type = t_string;
operand->mode = Addressing_Value; operand->mode = Addressing_Value;