Skip to content

Commit 530fe1d

Browse files
brsongraydon
authored andcommitted
Add a cleanup to trans_send. Express further confusion about cleanups in trans_recv
1 parent 0bcf493 commit 530fe1d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/comp/middle/trans.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4793,7 +4793,8 @@ fn trans_send(@block_ctxt cx, @ast.expr lhs, @ast.expr rhs,
47934793
auto data_tmp = copy_ty(bcx, INIT, data_alloc.val, data.val, unit_ty);
47944794
bcx = data_tmp.bcx;
47954795

4796-
// TODO: Cleanups?
4796+
find_scope_cx(bcx).cleanups +=
4797+
vec(clean(bind drop_ty(_, data_alloc.val, unit_ty)));
47974798

47984799
auto sub = trans_upcall(bcx, "upcall_send",
47994800
vec(vp2i(bcx, chn.val),
@@ -4823,7 +4824,7 @@ fn trans_recv(@block_ctxt cx, @ast.expr lhs, @ast.expr rhs,
48234824
auto cp = copy_ty(bcx, DROP_EXISTING, data.res.val, data_load, unit_ty);
48244825
bcx = cp.bcx;
48254826

4826-
// TODO: Cleanups?
4827+
// TODO: Any cleanup need to be done here?
48274828

48284829
ret res(bcx, data.res.val);
48294830
}

0 commit comments

Comments
 (0)