Skip to content

Commit 95337a2

Browse files
committed
Add missing lifetime intrinsics in a few places
1 parent 6c512dc commit 95337a2

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

src/librustc_trans/trans/cleanup.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,9 @@ impl<'blk, 'tcx> CleanupHelperMethods<'blk, 'tcx> for FunctionContext<'blk, 'tcx
730730
let prev_bcx = self.new_block(true, "resume", None);
731731
let personality = self.personality.get().expect(
732732
"create_landing_pad() should have set this");
733-
build::Resume(prev_bcx,
734-
build::Load(prev_bcx, personality));
733+
let lp = build::Load(prev_bcx, personality);
734+
base::call_lifetime_end(prev_bcx, personality);
735+
build::Resume(prev_bcx, lp);
735736
prev_llbb = prev_bcx.llbb;
736737
break;
737738
}

src/librustc_trans/trans/foreign.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ pub fn trans_native_call<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
432432
// - Truncating foreign type to correct integral type and then
433433
// bitcasting to the struct type yields invalid cast errors.
434434
let llscratch = base::alloca(bcx, llforeign_ret_ty, "__cast");
435+
base::call_lifetime_start(bcx, llscratch);
435436
Store(bcx, llforeign_retval, llscratch);
436437
let llscratch_i8 = BitCast(bcx, llscratch, Type::i8(ccx).ptr_to());
437438
let llretptr_i8 = BitCast(bcx, llretptr, Type::i8(ccx).ptr_to());
@@ -442,6 +443,7 @@ pub fn trans_native_call<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
442443
debug!("llrust_size={}", llrust_size);
443444
base::call_memcpy(bcx, llretptr_i8, llscratch_i8,
444445
C_uint(ccx, llrust_size), llalign as u32);
446+
base::call_lifetime_end(bcx, llscratch);
445447
}
446448
}
447449

src/librustc_trans/trans/glue.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ pub fn drop_ty_immediate<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
190190
let vp = alloca(bcx, type_of(bcx.ccx(), t), "");
191191
call_lifetime_start(bcx, vp);
192192
store_ty(bcx, v, vp, t);
193-
drop_ty_core(bcx, vp, t, debug_loc, skip_dtor, None)
193+
let bcx = drop_ty_core(bcx, vp, t, debug_loc, skip_dtor, None);
194+
call_lifetime_end(bcx, vp);
195+
bcx
194196
}
195197

196198
pub fn get_drop_glue<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> ValueRef {

src/librustc_trans/trans/intrinsic.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,7 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
966966
match dest {
967967
expr::Ignore => {
968968
bcx = glue::drop_ty(bcx, llresult, ret_ty, call_debug_location);
969+
call_lifetime_end(bcx, llresult);
969970
}
970971
expr::SaveIn(_) => {}
971972
}

0 commit comments

Comments
 (0)