@@ -243,7 +243,8 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
243
243
dest
244
244
} ;
245
245
246
- fcx. pop_custom_cleanup_scope ( cleanup_scope) ;
246
+ fcx. scopes . borrow_mut ( ) . last_mut ( ) . unwrap ( ) . drop_non_lifetime_clean ( ) ;
247
+ fcx. pop_and_trans_custom_cleanup_scope ( bcx, cleanup_scope) ;
247
248
248
249
return match dest {
249
250
expr:: SaveIn ( d) => Result :: new ( bcx, d) ,
@@ -268,17 +269,19 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
268
269
false ,
269
270
RustIntrinsic ) ;
270
271
271
- fcx. pop_custom_cleanup_scope ( cleanup_scope ) ;
272
+ fcx. scopes . borrow_mut ( ) . last_mut ( ) . unwrap ( ) . drop_non_lifetime_clean ( ) ;
272
273
273
274
let call_debug_location = DebugLoc :: At ( call_info. id , call_info. span ) ;
274
275
275
276
// These are the only intrinsic functions that diverge.
276
277
if name. get ( ) == "abort" {
277
278
let llfn = ccx. get_intrinsic ( & ( "llvm.trap" ) ) ;
278
279
Call ( bcx, llfn, & [ ] , None , call_debug_location) ;
280
+ fcx. pop_and_trans_custom_cleanup_scope ( bcx, cleanup_scope) ;
279
281
Unreachable ( bcx) ;
280
282
return Result :: new ( bcx, C_undef ( Type :: nil ( ccx) . ptr_to ( ) ) ) ;
281
283
} else if name. get ( ) == "unreachable" {
284
+ fcx. pop_and_trans_custom_cleanup_scope ( bcx, cleanup_scope) ;
282
285
Unreachable ( bcx) ;
283
286
return Result :: new ( bcx, C_nil ( ccx) ) ;
284
287
}
@@ -765,6 +768,8 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
765
768
expr:: SaveIn ( _) => { }
766
769
}
767
770
771
+ fcx. pop_and_trans_custom_cleanup_scope ( bcx, cleanup_scope) ;
772
+
768
773
Result :: new ( bcx, llresult)
769
774
}
770
775
0 commit comments