Increment ref counts of objects sent along channels.

This commit is contained in:
Michael Bebenita 2010-08-11 15:07:18 -07:00
parent 8ac15c6844
commit 18beb7a33d

View File

@ -2258,8 +2258,17 @@ let trans_visitor
trans_void_upcall "upcall_join" [| trans_atom (Ast.ATOM_lval task) |]
and trans_send (chan:Ast.lval) (src:Ast.lval) : unit =
let (srccell, _) = trans_lval src in
aliasing false srccell
let (src_cell, src_ty) = trans_lval src in
begin
match (ty_mem_ctrl src_ty) with
| MEM_rc_opaque
| MEM_rc_struct
| MEM_gc ->
iflog (fun _ -> annotate "incr_refcount of src obj");
incr_refcount src_cell;
| _ -> ()
end;
aliasing false src_cell
begin
fun src_alias ->
trans_void_upcall "upcall_send"