diff options
| author | Simonas Kazlauskas <git@kazlauskas.me> | 2016-05-26 11:26:03 +0300 |
|---|---|---|
| committer | Simonas Kazlauskas <git@kazlauskas.me> | 2016-05-26 11:26:03 +0300 |
| commit | 2f0da79e4723f3535367581099dc59d1289a3c7c (patch) | |
| tree | e6a0bd8de2c563550758945db2a295dd3ea43cea | |
| parent | e0e50a4b74c4e52e696cfe2608c3ed54a18e411f (diff) | |
| download | rust-2f0da79e4723f3535367581099dc59d1289a3c7c.tar.gz rust-2f0da79e4723f3535367581099dc59d1289a3c7c.zip | |
Do not forget to schedule the drop for the argument
| -rw-r--r-- | src/librustc_trans/base.rs | 5 |
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")) } |
