From a6f615edde21c3be638d9588c6c9a98cfe0bb5d9 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Fri, 13 Mar 2020 18:08:23 -0400 Subject: fixed small bug --- copy.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/copy.c b/copy.c index 4270086..4f6402c 100644 --- a/copy.c +++ b/copy.c @@ -206,9 +206,8 @@ static void copy_fn_expr(Copier *c, FnExpr *fout, FnExpr *fin, U8 flags) { fout->foreign.ctypes = copier_malloc(c, nctypes * sizeof(CType)); memcpy(fout->foreign.ctypes, fin->foreign.ctypes, nctypes * sizeof(CType)); } else { - Block *prev; + Block *prev = c->block; if (copy_body) { - prev = c->block; c->block = &fout->body; idents_create(&fout->body.idents, c->allocr, &fout->body); } @@ -231,10 +230,10 @@ static void copy_fn_expr(Copier *c, FnExpr *fout, FnExpr *fin, U8 flags) { if (fin->condition) { fout->condition = copy_expr_(c, fin->condition); } - c->block = prev; - if (copy_body) { - copy_block(c, &fout->body, &fin->body, copy_body ? COPY_BLOCK_DONT_CREATE_IDENTS : 0); - } + } + c->block = prev; + if (copy_body) { + copy_block(c, &fout->body, &fin->body, copy_body ? COPY_BLOCK_DONT_CREATE_IDENTS : 0); } } } -- cgit v1.2.3