aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-07-02 01:03:58 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-07-02 01:03:58 +0200
commit5fe14d15635d62becb90a7c4277b89e8981b983c (patch)
treebb981feb1837cf195daac827b2f6a782bbfe44c7
parent21d3e8c4bf7726b3ad4180119d75ccc0f69cf32b (diff)
Fix out-of-order definitions
-rw-r--r--src/analyzer.c5
1 files 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;
}