diff options
| author | Brian Anderson <[email protected]> | 2011-03-21 22:32:11 -0400 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-03-22 08:04:53 -0700 |
| commit | 530fe1daea2d99bf6a2be132766c43489b6cfd8a (patch) | |
| tree | d93da773813d79ff211456fc456b71ecb5aa8bcc /src/comp | |
| parent | Add test for sending strings over channels (diff) | |
| download | rust-530fe1daea2d99bf6a2be132766c43489b6cfd8a.tar.xz rust-530fe1daea2d99bf6a2be132766c43489b6cfd8a.zip | |
Add a cleanup to trans_send. Express further confusion about cleanups in trans_recv
Diffstat (limited to 'src/comp')
| -rw-r--r-- | src/comp/middle/trans.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index b1deb1f1..bc43185a 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -4793,7 +4793,8 @@ fn trans_send(@block_ctxt cx, @ast.expr lhs, @ast.expr rhs, auto data_tmp = copy_ty(bcx, INIT, data_alloc.val, data.val, unit_ty); bcx = data_tmp.bcx; - // TODO: Cleanups? + find_scope_cx(bcx).cleanups += + vec(clean(bind drop_ty(_, data_alloc.val, unit_ty))); auto sub = trans_upcall(bcx, "upcall_send", vec(vp2i(bcx, chn.val), @@ -4823,7 +4824,7 @@ fn trans_recv(@block_ctxt cx, @ast.expr lhs, @ast.expr rhs, auto cp = copy_ty(bcx, DROP_EXISTING, data.res.val, data_load, unit_ty); bcx = cp.bcx; - // TODO: Cleanups? + // TODO: Any cleanup need to be done here? ret res(bcx, data.res.val); } |