diff options
| author | Graydon Hoare <[email protected]> | 2010-06-24 13:32:59 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-06-24 13:32:59 -0700 |
| commit | af44ec2856603b8a978a1f2582c285c7c0065403 (patch) | |
| tree | 7cc4d0ad4765a2b320580355242a15027eb97062 /src/boot | |
| parent | Remove redundant copy of comment. (diff) | |
| download | rust-af44ec2856603b8a978a1f2582c285c7c0065403.tar.xz rust-af44ec2856603b8a978a1f2582c285c7c0065403.zip | |
Issue 24, drop output slot when not initializing. Un-XFAIL generic-tag.rs. Add test for output slot modes with several broken cases.
Diffstat (limited to 'src/boot')
| -rw-r--r-- | src/boot/me/trans.ml | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/boot/me/trans.ml b/src/boot/me/trans.ml index fe4a542f..cb492561 100644 --- a/src/boot/me/trans.ml +++ b/src/boot/me/trans.ml @@ -3708,7 +3708,7 @@ let trans_visitor and trans_prepare_call - ((*initializing*)_:bool) + (initializing:bool) (logname:(unit -> string)) (call:call) : Il.operand = @@ -3718,11 +3718,15 @@ let trans_visitor (Printf.sprintf "copy args for call to %s" (logname ()))); copy_fn_args false CLONE_none call; iflog (fun _ -> annotate (Printf.sprintf "call %s" (logname ()))); - (* FIXME (issue #24): we need to actually handle writing to an - * already-initialised slot. Currently we blindly assume we're - * initializing, overwrite the slot; this is ok if we're writing - * to an interior output slot, but we'll leak any exteriors as we - * do that. *) + if not initializing + then + begin + match call.call_callee_ty with + Ast.TY_fn (tsig, _) -> + drop_slot (get_ty_params_of_current_frame()) call.call_output + tsig.Ast.sig_output_slot None; + | _ -> bug () "calling non-fn" + end; callee_fptr and callee_drop_slot |