From 14d7fd1d08044dc1bb2f3c11d7e807662ab79666 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Tue, 11 Jun 2024 19:22:18 +0200 Subject: [PATCH] Additional macro inlining error improvements. --- src/compiler/sema_expr.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/compiler/sema_expr.c b/src/compiler/sema_expr.c index 7be99c159..1faecb0f6 100644 --- a/src/compiler/sema_expr.c +++ b/src/compiler/sema_expr.c @@ -8853,9 +8853,16 @@ bool sema_analyse_inferred_expr(SemaContext *context, Type *infer_type, Expr *ex switch (expr->expr_kind) { case EXPR_OTHER_CONTEXT: + { + InliningSpan *new_span = context->inlined_at; context = expr->expr_other_context.context; + InliningSpan *old_span = context->inlined_at; + context->inlined_at = new_span; expr_replace(expr, expr->expr_other_context.inner); - return sema_analyse_inferred_expr(context, infer_type, expr); + bool success = sema_analyse_inferred_expr(context, infer_type, expr); + context->inlined_at = old_span; + return success; + } case EXPR_DESIGNATED_INITIALIZER_LIST: case EXPR_INITIALIZER_LIST: if (!sema_expr_analyse_initializer_list(context, infer_type, expr)) return expr_poison(expr);