about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSimonas Kazlauskas <git@kazlauskas.me>2016-05-26 11:26:03 +0300
committerSimonas Kazlauskas <git@kazlauskas.me>2016-05-26 11:26:03 +0300
commit2f0da79e4723f3535367581099dc59d1289a3c7c (patch)
treee6a0bd8de2c563550758945db2a295dd3ea43cea
parente0e50a4b74c4e52e696cfe2608c3ed54a18e411f (diff)
downloadrust-2f0da79e4723f3535367581099dc59d1289a3c7c.tar.gz
rust-2f0da79e4723f3535367581099dc59d1289a3c7c.zip
Do not forget to schedule the drop for the argument
-rw-r--r--src/librustc_trans/base.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustc_trans/base.rs b/src/librustc_trans/base.rs
index ddfa08516e5..712805061ea 100644
--- a/src/librustc_trans/base.rs
+++ b/src/librustc_trans/base.rs
@@ -1660,8 +1660,8 @@ impl<'blk, 'tcx> FunctionContext<'blk, 'tcx> {
                     self.schedule_drop_mem(arg_scope_id, llarg, arg_ty, None);
 
                     datum::Datum::new(llarg,
-                                    arg_ty,
-                                    datum::Lvalue::new("FunctionContext::bind_args"))
+                                      arg_ty,
+                                      datum::Lvalue::new("FunctionContext::bind_args"))
                 } else {
                     let lltmp = if common::type_is_fat_ptr(bcx.tcx(), arg_ty) {
                         let lltemp = alloc_ty(bcx, arg_ty, "");
@@ -1683,6 +1683,7 @@ impl<'blk, 'tcx> FunctionContext<'blk, 'tcx> {
                         // And coerce the temporary into the type we expect.
                         b.pointercast(lltemp, arg.memory_ty(bcx.ccx()).ptr_to())
                     };
+                    bcx.fcx.schedule_drop_mem(arg_scope_id, lltmp, arg_ty, None);
                     datum::Datum::new(lltmp, arg_ty,
                                       datum::Lvalue::new("bind_args"))
                 }