diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-03-13 18:08:23 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-03-13 18:08:23 -0400 |
commit | a6f615edde21c3be638d9588c6c9a98cfe0bb5d9 (patch) | |
tree | d12845de3daaa67e81caf293eb04a3b0d231db3d | |
parent | 72101f2f5b80ae3c8889424351664fd651a84dec (diff) |
fixed small bug
-rw-r--r-- | copy.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -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); } } } |