@@ -475,17 +475,17 @@ fn ensure_struct_fits_in_address_space<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
475
475
scapegoat : Ty < ' tcx > ) {
476
476
let mut offset = 0 ;
477
477
for & llty in fields. iter ( ) {
478
- // Invariant: offset < ccx.max_obj_size () <= 1<<61
478
+ // Invariant: offset < ccx.obj_size_bound () <= 1<<61
479
479
if !packed {
480
480
let type_align = machine:: llalign_of_min ( ccx, llty) ;
481
481
offset = roundup ( offset, type_align) ;
482
482
}
483
- // type_align is a power-of-2, so still offset < ccx.max_obj_size ()
484
- // llsize_of_alloc(ccx, llty) is also less than ccx.max_obj_size ()
483
+ // type_align is a power-of-2, so still offset < ccx.obj_size_bound ()
484
+ // llsize_of_alloc(ccx, llty) is also less than ccx.obj_size_bound ()
485
485
// so the sum is less than 1<<62 (and therefore can't overflow).
486
486
offset += machine:: llsize_of_alloc ( ccx, llty) ;
487
487
488
- if offset >= ccx. max_obj_size ( ) {
488
+ if offset >= ccx. obj_size_bound ( ) {
489
489
ccx. report_overbig_object ( scapegoat) ;
490
490
}
491
491
}
@@ -504,11 +504,11 @@ fn ensure_enum_fits_in_address_space<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
504
504
let discr_size = machine:: llsize_of_alloc ( ccx, ll_inttype ( ccx, discr) ) ;
505
505
let ( field_size, field_align) = union_size_and_align ( fields) ;
506
506
507
- // field_align < 1<<32, discr_size <= 8, field_size < MAX_OBJ_SIZE <= 1<<61
507
+ // field_align < 1<<32, discr_size <= 8, field_size < OBJ_SIZE_BOUND <= 1<<61
508
508
// so the sum is less than 1<<62 (and can't overflow).
509
509
let total_size = roundup ( discr_size, field_align) + field_size;
510
510
511
- if total_size >= ccx. max_obj_size ( ) {
511
+ if total_size >= ccx. obj_size_bound ( ) {
512
512
ccx. report_overbig_object ( scapegoat) ;
513
513
}
514
514
}
0 commit comments