aboutsummaryrefslogtreecommitdiff
path: root/src/boot/me
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-09-30 17:39:37 -0700
committerGraydon Hoare <[email protected]>2010-09-30 17:39:37 -0700
commit2e0d07540702ac6cabcc5670660c72f898d5cbd2 (patch)
treedf48c5f8070eb55f00db7c435e569782dee26d09 /src/boot/me
parentDrop slots on block exits even when blocks have no statements. Part way to fi... (diff)
downloadrust-2e0d07540702ac6cabcc5670660c72f898d5cbd2.tar.xz
rust-2e0d07540702ac6cabcc5670660c72f898d5cbd2.zip
Fix bug in bind thunks failing top drop unbound args; add test and adjust rustc to use bind again.
Diffstat (limited to 'src/boot/me')
-rw-r--r--src/boot/me/trans.ml16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/boot/me/trans.ml b/src/boot/me/trans.ml
index d8be85bf..ce6f5d92 100644
--- a/src/boot/me/trans.ml
+++ b/src/boot/me/trans.ml
@@ -1640,12 +1640,28 @@ let trans_visitor
get_element_ptr closure_target_cell Abi.fn_field_code
in
+ let self_args_cell =
+ get_element_ptr all_self_args_cell Abi.calltup_elt_args
+ in
+
+ let self_ty_params_cell =
+ get_element_ptr all_self_args_cell Abi.calltup_elt_ty_params
+ in
+
merge_bound_args
self_args_rty callee_args_rty
arg_slots arg_bound_flags;
iflog (fun _ -> annotate "call through to closure target fn");
call_code (code_of_cell closure_target_code_cell);
+
+ (* Drop the args we were passed. *)
+ Array.iteri
+ (fun i slot ->
+ let cell = get_element_ptr self_args_cell i in
+ drop_slot self_ty_params_cell cell slot)
+ unbound_slots;
+
trans_glue_frame_exit fix spill g