disallows odin cc with #must_tail

This commit is contained in:
Mihail Moskov committed 2026-10-01 15:09:24 +03:00
1 parent f6bf50612a
commit 016414cc88
2 files changed
+14 -1

No files matched your search

+6 -1
View File
@@ -9274,7 +9274,12 @@ gb_internal ExprKind check_call_expr(CheckerContext *c, Operand *operand, Ast *c
break;
case ProcTailing_must_tail:
is_call_tailed = true;
if (c->curr_proc_sig == nullptr || !are_types_identical(c->curr_proc_sig, pt)) {
if (pt->kind == Type_Proc && !is_calling_convention_must_tail_allowed(pt->Proc.calling_convention)) {
ERROR_BLOCK();
error(call, "'#must_tail' cannot be applied to a call of a procedure with the \"%s\" calling convention",
proc_calling_convention_strings[pt->Proc.calling_convention]);
error_line("\tSuggestion: Use the \"preserve/none\" calling convention\n");
} else if (c->curr_proc_sig == nullptr || !are_types_identical(c->curr_proc_sig, pt)) {
ERROR_BLOCK();
gbString a = type_to_string(pt);
gbString b = type_to_string(c->curr_proc_sig);