@@ -3473,14 +3473,18 @@ mod ivec {
3473
3473
}
3474
3474
}
3475
3475
3476
+ auto rslt = size_of( cx, unit_ty) ;
3477
+ auto bcx = rslt. bcx;
3478
+ auto unit_sz = rslt. val;
3479
+
3476
3480
// Gather the various type descriptors we'll need.
3477
3481
3478
3482
// FIXME (issue #511): This is needed to prevent a leak.
3479
3483
auto no_tydesc_info = none;
3480
3484
3481
- auto rslt = get_tydesc( cx , t, false, no_tydesc_info) ;
3485
+ rslt = get_tydesc( bcx , t, false, no_tydesc_info) ;
3482
3486
auto vec_tydesc = rslt. val;
3483
- auto bcx = rslt. bcx;
3487
+ bcx = rslt. bcx;
3484
3488
rslt = get_tydesc( bcx, unit_ty, false, no_tydesc_info) ;
3485
3489
auto unit_tydesc = rslt. val;
3486
3490
bcx = rslt. bcx;
@@ -3526,12 +3530,19 @@ mod ivec {
3526
3530
auto post_copy_cx = rslt. bcx;
3527
3531
// Increment both pointers.
3528
3532
3529
- post_copy_cx. build. Store ( post_copy_cx. build. InBoundsGEP ( copy_dest_ptr,
3530
- [ C_int ( 1 ) ] ) ,
3531
- dest_ptr) ;
3532
- post_copy_cx. build. Store ( post_copy_cx. build. InBoundsGEP ( copy_src_ptr,
3533
- [ C_int ( 1 ) ] ) ,
3534
- src_ptr) ;
3533
+ if ( ty:: type_has_dynamic_size( cx. fcx. lcx. ccx. tcx, t) ) {
3534
+ // We have to increment by the dynamically-computed size.
3535
+ post_copy_cx. build. Store ( post_copy_cx. build. InBoundsGEP (
3536
+ copy_dest_ptr, [ unit_sz] ) , dest_ptr) ;
3537
+ post_copy_cx. build. Store ( post_copy_cx. build. InBoundsGEP (
3538
+ copy_src_ptr, [ unit_sz] ) , src_ptr) ;
3539
+ } else {
3540
+ post_copy_cx. build. Store ( post_copy_cx. build. InBoundsGEP (
3541
+ copy_dest_ptr, [ C_int ( 1 ) ] ) , dest_ptr) ;
3542
+ post_copy_cx. build. Store ( post_copy_cx. build. InBoundsGEP (
3543
+ copy_src_ptr, [ C_int ( 1 ) ] ) , src_ptr) ;
3544
+ }
3545
+
3535
3546
post_copy_cx. build. Br ( copy_loop_header_cx. llbb) ;
3536
3547
ret res( next_cx, C_nil ( ) ) ;
3537
3548
}
@@ -6656,7 +6667,8 @@ fn new_block_ctxt(&@fn_ctxt cx, &block_parent parent, block_kind kind,
6656
6667
& str name) -> @block_ctxt {
6657
6668
let vec[ cleanup] cleanups = [ ] ;
6658
6669
auto s = str :: buf( "") ;
6659
- if ( cx. lcx. ccx. sess. get_opts( ) . save_temps) {
6670
+ if ( cx. lcx. ccx. sess. get_opts( ) . save_temps ||
6671
+ cx. lcx. ccx. sess. get_opts( ) . debuginfo) {
6660
6672
s = str :: buf( cx. lcx. ccx. names. next( name) ) ;
6661
6673
}
6662
6674
let BasicBlockRef llbb = llvm:: LLVMAppendBasicBlock ( cx. llfn, s) ;
0 commit comments