From 5fe14d15635d62becb90a7c4277b89e8981b983c Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 2 Jul 2024 01:03:58 +0200 Subject: Fix out-of-order definitions --- src/analyzer.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/analyzer.c b/src/analyzer.c index 5f5771d..6dff9ff 100644 --- a/src/analyzer.c +++ b/src/analyzer.c @@ -626,13 +626,12 @@ constfoldexpr(struct azctx *ctx, type_t *T, idx_t i) case ASTCDECL: { idx_t expr = ctx->ast.kids[sym->i].rhs; assert(expr != AST_EMPTY); - MPQCPY(ctx->folds[i], ctx->folds[expr]); if (!MPQ_IS_INIT(ctx->folds[i])) { ctx->si = lvl; (void)constfolddecl(ctx, sym->i); - MPQCPY(ctx->folds[i], ctx->folds[expr]); - assert(MPQ_IS_INIT(ctx->folds[i])); } + MPQCPY(ctx->folds[i], ctx->folds[expr]); + assert(MPQ_IS_INIT(ctx->folds[i])); ni = fwdnode(ctx->ast, i); goto out; } -- cgit v1.2.3