@@ -464,17 +464,17 @@ fn ensure_struct_fits_in_address_space(ccx: &CrateContext,
464
464
scapegoat : ty:: t ) {
465
465
let mut offset = 0 ;
466
466
for & llty in fields. iter ( ) {
467
- // Invariant: offset < ccx.max_obj_size () <= 1<<61
467
+ // Invariant: offset < ccx.obj_size_bound () <= 1<<61
468
468
if !packed {
469
469
let type_align = machine:: llalign_of_min ( ccx, llty) ;
470
470
offset = roundup ( offset, type_align) ;
471
471
}
472
- // type_align is a power-of-2, so still offset < ccx.max_obj_size ()
473
- // llsize_of_alloc(ccx, llty) is also less than ccx.max_obj_size ()
472
+ // type_align is a power-of-2, so still offset < ccx.obj_size_bound ()
473
+ // llsize_of_alloc(ccx, llty) is also less than ccx.obj_size_bound ()
474
474
// so the sum is less than 1<<62 (and therefore can't overflow).
475
475
offset += machine:: llsize_of_alloc ( ccx, llty) ;
476
476
477
- if offset >= ccx. max_obj_size ( ) {
477
+ if offset >= ccx. obj_size_bound ( ) {
478
478
ccx. report_overbig_object ( scapegoat) ;
479
479
}
480
480
}
@@ -493,11 +493,11 @@ fn ensure_enum_fits_in_address_space(ccx: &CrateContext,
493
493
let discr_size = machine:: llsize_of_alloc ( ccx, ll_inttype ( ccx, discr) ) ;
494
494
let ( field_size, field_align) = union_size_and_align ( fields) ;
495
495
496
- // field_align < 1<<32, discr_size <= 8, field_size < MAX_OBJ_SIZE <= 1<<61
496
+ // field_align < 1<<32, discr_size <= 8, field_size < OBJ_SIZE_BOUND <= 1<<61
497
497
// so the sum is less than 1<<62 (and can't overflow).
498
498
let total_size = roundup ( discr_size, field_align) + field_size;
499
499
500
- if total_size >= ccx. max_obj_size ( ) {
500
+ if total_size >= ccx. obj_size_bound ( ) {
501
501
ccx. report_overbig_object ( scapegoat) ;
502
502
}
503
503
}
0 commit comments