mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
Fix regression, not permitting macro parameters inlined into naked functions.
This commit is contained in:
@@ -75,7 +75,7 @@ static inline Decl *sema_resolve_external_symbol(SemaContext *context, Expr *exp
|
||||
SEMA_ERROR(expr, "Optional variables are not allowed in asm.");
|
||||
return NULL;
|
||||
}
|
||||
if (decl->var.kind == VARDECL_PARAM && context->call_env.is_naked_fn)
|
||||
if (decl->var.kind == VARDECL_PARAM && context->call_env.is_naked_fn && !(context->active_scope.flags & SCOPE_MACRO))
|
||||
{
|
||||
SEMA_ERROR(expr, "Function parameters in '@naked' functions may not be directly referenced.");
|
||||
return NULL;
|
||||
|
||||
@@ -1263,7 +1263,7 @@ static inline bool sema_expr_analyse_identifier(SemaContext *context, Type *to,
|
||||
}
|
||||
break;
|
||||
case VARDECL_PARAM:
|
||||
if (context->call_env.is_naked_fn)
|
||||
if (context->call_env.is_naked_fn && !(context->active_scope.flags & SCOPE_MACRO))
|
||||
{
|
||||
RETURN_SEMA_ERROR(expr, "Parameters may not be directly accessed in '@naked' functions.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user