about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorBrian Anderson <andersrb@gmail.com>2011-03-21 22:32:11 -0400
committerGraydon Hoare <graydon@mozilla.com>2011-03-22 08:04:53 -0700
commit530fe1daea2d99bf6a2be132766c43489b6cfd8a (patch)
treed93da773813d79ff211456fc456b71ecb5aa8bcc /src/comp
parent0bcf49305cf34d6894c94b2eb8efcb3c022ffc0d (diff)
downloadrust-530fe1daea2d99bf6a2be132766c43489b6cfd8a.tar.gz
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.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index b1deb1f185f..bc43185a799 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);
 }