diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-03-13 15:32:12 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-03-13 15:32:12 -0400 |
commit | 7bb5ac5863bdb4bc7af04ee18e81657a85aa97f2 (patch) | |
tree | 3e0be40e792e403eb7d9f6c0f88c732203757894 /copy.c | |
parent | 45e0055c8bbfa5474fcd7c951428b4ca84b0ed04 (diff) |
added where conditions for functions, discovered bug with eval returning
Diffstat (limited to 'copy.c')
-rw-r--r-- | copy.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -227,8 +227,12 @@ static void copy_fn_expr(Copier *c, FnExpr *fout, FnExpr *fin, U8 flags) { copy_decl(c, fout->ret_decls + i, fin->ret_decls + i); } copy_type(c, &fout->ret_type, &fin->ret_type); + + if (fin->condition) { + fout->condition = copy_expr_(c, fin->condition); + } + c->block = prev; if (copy_body) { - c->block = prev; copy_block(c, &fout->body, &fin->body, copy_body ? COPY_BLOCK_DONT_CREATE_IDENTS : 0); } } |