Skip to content

Commit 5007abd

Browse files
author
Eric Holk
committed
---
yaml --- r: 4080 b: refs/heads/master c: 54be5b0 h: refs/heads/master v: v3
1 parent 0c2bb89 commit 5007abd

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 75ee817713f3352f2f80639c99ee2ec4477dfd66
2+
refs/heads/master: 54be5b044f71ca9e191b26b2e65ff6541f377358

trunk/src/comp/middle/trans_comm.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,14 @@ fn trans_send(&@block_ctxt cx, &@ast::expr lhs, &@ast::expr rhs,
216216
auto data_tmp = move_val_if_temp(bcx, INIT, data_alloc.val,
217217
data, unit_ty);
218218
bcx = data_tmp.bcx;
219-
add_clean_temp(bcx, data_alloc.val, unit_ty);
220219
auto llchanval = bcx.build.PointerCast(chn.val, T_opaque_chan_ptr());
221220
auto lldataptr = bcx.build.PointerCast(data_alloc.val, T_ptr(T_i8()));
222221
bcx.build.Call(bcx.fcx.lcx.ccx.upcalls.send,
223222
~[bcx.fcx.lltaskptr, llchanval, lldataptr]);
223+
224+
// Deinit the stuff we sent.
225+
bcx = zero_alloca(bcx, data_alloc.val, unit_ty).bcx;
226+
224227
ret rslt(bcx, chn.val);
225228
auto unit_ty;
226229
}
@@ -231,7 +234,6 @@ fn trans_recv(&@block_ctxt cx, &@ast::expr lhs, &@ast::expr rhs,
231234
auto data = trans_lval(bcx, rhs);
232235
assert (data.is_mem);
233236
bcx = data.res.bcx;
234-
auto unit_ty = node_id_type(bcx.fcx.lcx.ccx, id);
235237
// FIXME: calculate copy init-ness in typestate.
236238

237239
auto prt = trans_expr(bcx, lhs);
@@ -241,13 +243,8 @@ fn trans_recv(&@block_ctxt cx, &@ast::expr lhs, &@ast::expr rhs,
241243
auto llportptr = bcx.build.PointerCast(prt.val, T_opaque_port_ptr());
242244
bcx.build.Call(bcx.fcx.lcx.ccx.upcalls.recv,
243245
~[bcx.fcx.lltaskptr, lldataptr, llportptr]);
244-
auto data_load = load_if_immediate(bcx, data.res.val, unit_ty);
245-
//auto cp = copy_val(bcx, DROP_EXISTING,
246-
// data.res.val, data_load, unit_ty);
247-
//bcx = cp.bcx;
248246

249-
add_clean_temp(cx, data_load, unit_ty);
250-
ret rslt(bcx, data_load);
247+
ret rslt(bcx, data.res.val);
251248
}
252249

253250
// Does a deep copy of a value. This is needed for passing arguments to child

trunk/src/test/run-pass/task-comm-10.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ fn main() {
2323

2424
p = port();
2525
child = spawn start(chan(p));
26+
auto c;
2627

2728
p |> c;
2829
c <| "A";
2930
c <| "B";
3031
task::yield();
31-
32-
auto c;
3332
}

trunk/src/test/run-pass/task-comm-11.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// xfail-stage0
2-
// xfail-stage1
3-
// xfail-stage2
42
// xfail-stage3
53

64
fn start(chan[chan[str]] c) {

0 commit comments

Comments
 (0)