diff options
| author | Simonas Kazlauskas <git@kazlauskas.me> | 2016-05-26 11:26:03 +0300 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2016-05-26 09:49:26 -0700 |
| commit | edb1fb0cd9da03f32828d370b9981b72d236ee1b (patch) | |
| tree | 208e0e6381f4d6d8bb288fbdfcd446657498f459 | |
| parent | 219e69dcb2667a46b4d7ff29bb95ded51f603102 (diff) | |
| download | rust-edb1fb0cd9da03f32828d370b9981b72d236ee1b.tar.gz rust-edb1fb0cd9da03f32828d370b9981b72d236ee1b.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 3e1c2fa4283..c6d072c5399 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")) } |
