@@ -2179,18 +2179,15 @@ fn move_val(cx: @block_ctxt, action: copy_action, dst: ValueRef,
2179
2179
if src. is_mem { ret zero_alloca ( cx, src. res . val , t) . bcx ; }
2180
2180
2181
2181
// If we're here, it must be a temporary.
2182
- revoke_clean ( cx, src_val) ;
2183
- ret cx;
2182
+ ret revoke_clean ( cx, src_val, t) ;
2184
2183
} else if ty:: type_is_unique ( tcx, t) ||
2185
2184
type_is_structural_or_param ( tcx, t) {
2186
2185
if action == DROP_EXISTING { cx = drop_ty ( cx, dst, t) ; }
2187
2186
cx = memmove_ty ( cx, dst, src_val, t) . bcx ;
2188
- if src. is_mem {
2189
- ret zero_alloca ( cx, src_val, t) . bcx ;
2190
- } else { // Temporary value
2191
- revoke_clean ( cx, src_val) ;
2192
- ret cx;
2193
- }
2187
+ if src. is_mem { ret zero_alloca ( cx, src_val, t) . bcx ; }
2188
+
2189
+ // If we're here, it must be a temporary.
2190
+ ret revoke_clean ( cx, src_val, t) ;
2194
2191
}
2195
2192
bcx_ccx ( cx) . sess . bug ( "unexpected type in trans::move_val: " +
2196
2193
ty_to_str ( tcx, t) ) ;
@@ -3620,7 +3617,8 @@ fn trans_bind_1(cx: &@block_ctxt, f: &@ast::expr, f_res: &lval_result,
3620
3617
3621
3618
fn trans_arg_expr ( cx : & @block_ctxt , arg : & ty:: arg , lldestty0 : TypeRef ,
3622
3619
to_zero : & mutable [ { v: ValueRef , t : ty:: t } ] ,
3623
- to_revoke : & mutable [ ValueRef ] , e : & @ast:: expr ) -> result {
3620
+ to_revoke : & mutable [ { v: ValueRef , t : ty:: t } ] ,
3621
+ e : & @ast:: expr ) -> result {
3624
3622
let ccx = bcx_ccx ( cx) ;
3625
3623
let e_ty = ty:: expr_ty ( ccx. tcx , e) ;
3626
3624
let is_bot = ty:: type_is_bot ( ccx. tcx , e_ty) ;
@@ -3672,7 +3670,9 @@ fn trans_arg_expr(cx: &@block_ctxt, arg: &ty::arg, lldestty0: TypeRef,
3672
3670
// Use actual ty, not declared ty -- anything else doesn't make
3673
3671
// sense if declared ty is a ty param
3674
3672
to_zero += [ { v: lv. res . val , t: e_ty} ] ;
3675
- } else { to_revoke += [ lv. res . val ] ; }
3673
+ } else {
3674
+ to_revoke += [ { v: lv. res . val , t: e_ty} ] ;
3675
+ }
3676
3676
}
3677
3677
ret rslt( bcx, val) ;
3678
3678
}
@@ -3691,7 +3691,7 @@ fn trans_args(cx: &@block_ctxt, llenv: ValueRef,
3691
3691
args : [ ValueRef ] ,
3692
3692
retslot : ValueRef ,
3693
3693
to_zero : [ { v : ValueRef , t : ty:: t } ] ,
3694
- to_revoke : [ ValueRef ] } {
3694
+ to_revoke : [ { v : ValueRef , t : ty :: t } ] } {
3695
3695
3696
3696
let args: [ ty:: arg ] = ty:: ty_fn_args ( bcx_tcx ( cx) , fn_ty) ;
3697
3697
let llargs: [ ValueRef ] = [ ] ;
@@ -3869,9 +3869,11 @@ fn trans_call(in_cx: &@block_ctxt, f: &@ast::expr,
3869
3869
3870
3870
// Forget about anything we moved out.
3871
3871
for { v: v, t: t} : { v: ValueRef , t: ty:: t} in args_res. to_zero {
3872
- zero_alloca ( bcx, v, t)
3872
+ bcx = zero_alloca ( bcx, v, t) . bcx ;
3873
+ }
3874
+ for { v: v, t: t} in args_res. to_revoke {
3875
+ bcx = revoke_clean ( bcx, v, t) ;
3873
3876
}
3874
- for v: ValueRef in args_res. to_revoke { revoke_clean ( bcx, v) }
3875
3877
bcx = trans_block_cleanups ( bcx, cx) ;
3876
3878
let next_cx = new_sub_block_ctxt ( in_cx, "next" ) ;
3877
3879
Br ( bcx, next_cx. llbb ) ;
0 commit comments