Correctly type check asm template parameters

This commit is contained in:
gingerBill
2026-08-09 18:52:57 +01:00
parent 5ac28cdecd
commit 25ce7e87de
2 changed files with 8 additions and 1 deletions

View File

@@ -5933,7 +5933,8 @@ gb_internal Entity *check_selector(CheckerContext *c, Operand *operand, Ast *nod
add_entity_use(c, op_expr, e);
expr_entity = e;
if (e != nullptr && (e->kind == Entity_Procedure || e->kind == Entity_ProcGroup) && selector->kind == Ast_Ident) {
if (e != nullptr && (e->kind == Entity_Procedure || e->kind == Entity_ProcGroup || e->kind == Entity_AsmTemplate) &&
selector->kind == Ast_Ident) {
gbString sel_str = expr_to_string(selector);
error(node, "'%s' is not declared by '%.*s'", sel_str, LIT(e->token.string));
gb_string_free(sel_str);
@@ -6304,6 +6305,10 @@ gb_internal Entity *check_selector(CheckerContext *c, Operand *operand, Ast *nod
case Entity_Nil:
operand->mode = Addressing_Value;
break;
case Entity_AsmTemplate:
operand->mode = Addressing_Value;
break;
}
add_type_and_value(c, operand->expr, operand->mode, operand->type, operand->value);