summaryrefslogtreecommitdiff
path: root/copy.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-03-13 15:32:12 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-03-13 15:32:12 -0400
commit7bb5ac5863bdb4bc7af04ee18e81657a85aa97f2 (patch)
tree3e0be40e792e403eb7d9f6c0f88c732203757894 /copy.c
parent45e0055c8bbfa5474fcd7c951428b4ca84b0ed04 (diff)
added where conditions for functions, discovered bug with eval returning
Diffstat (limited to 'copy.c')
-rw-r--r--copy.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/copy.c b/copy.c
index 6f39dab..4270086 100644
--- a/copy.c
+++ b/copy.c
@@ -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);
}
}