Skip to content

Commit 2f0da79

Browse files
committed
Do not forget to schedule the drop for the argument
1 parent e0e50a4 commit 2f0da79

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustc_trans/base.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,8 +1660,8 @@ impl<'blk, 'tcx> FunctionContext<'blk, 'tcx> {
16601660
self.schedule_drop_mem(arg_scope_id, llarg, arg_ty, None);
16611661

16621662
datum::Datum::new(llarg,
1663-
arg_ty,
1664-
datum::Lvalue::new("FunctionContext::bind_args"))
1663+
arg_ty,
1664+
datum::Lvalue::new("FunctionContext::bind_args"))
16651665
} else {
16661666
let lltmp = if common::type_is_fat_ptr(bcx.tcx(), arg_ty) {
16671667
let lltemp = alloc_ty(bcx, arg_ty, "");
@@ -1683,6 +1683,7 @@ impl<'blk, 'tcx> FunctionContext<'blk, 'tcx> {
16831683
// And coerce the temporary into the type we expect.
16841684
b.pointercast(lltemp, arg.memory_ty(bcx.ccx()).ptr_to())
16851685
};
1686+
bcx.fcx.schedule_drop_mem(arg_scope_id, lltmp, arg_ty, None);
16861687
datum::Datum::new(lltmp, arg_ty,
16871688
datum::Lvalue::new("bind_args"))
16881689
}

0 commit comments

Comments
 (0)