@@ -216,11 +216,14 @@ fn trans_send(&@block_ctxt cx, &@ast::expr lhs, &@ast::expr rhs,
216
216
auto data_tmp = move_val_if_temp( bcx, INIT , data_alloc. val,
217
217
data, unit_ty) ;
218
218
bcx = data_tmp. bcx;
219
- add_clean_temp( bcx, data_alloc. val, unit_ty) ;
220
219
auto llchanval = bcx. build. PointerCast ( chn. val, T_opaque_chan_ptr ( ) ) ;
221
220
auto lldataptr = bcx. build. PointerCast ( data_alloc. val, T_ptr ( T_i8 ( ) ) ) ;
222
221
bcx. build. Call ( bcx. fcx. lcx. ccx. upcalls. send,
223
222
~[ bcx. fcx. lltaskptr, llchanval, lldataptr] ) ;
223
+
224
+ // Deinit the stuff we sent.
225
+ bcx = zero_alloca( bcx, data_alloc. val, unit_ty) . bcx;
226
+
224
227
ret rslt( bcx, chn. val) ;
225
228
auto unit_ty;
226
229
}
@@ -231,7 +234,6 @@ fn trans_recv(&@block_ctxt cx, &@ast::expr lhs, &@ast::expr rhs,
231
234
auto data = trans_lval( bcx, rhs) ;
232
235
assert ( data. is_mem) ;
233
236
bcx = data. res. bcx;
234
- auto unit_ty = node_id_type( bcx. fcx. lcx. ccx, id) ;
235
237
// FIXME: calculate copy init-ness in typestate.
236
238
237
239
auto prt = trans_expr( bcx, lhs) ;
@@ -241,13 +243,8 @@ fn trans_recv(&@block_ctxt cx, &@ast::expr lhs, &@ast::expr rhs,
241
243
auto llportptr = bcx. build. PointerCast ( prt. val, T_opaque_port_ptr ( ) ) ;
242
244
bcx. build. Call ( bcx. fcx. lcx. ccx. upcalls. recv,
243
245
~[ 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;
248
246
249
- add_clean_temp( cx, data_load, unit_ty) ;
250
- ret rslt( bcx, data_load) ;
247
+ ret rslt( bcx, data. res. val) ;
251
248
}
252
249
253
250
// Does a deep copy of a value. This is needed for passing arguments to child
0 commit comments