@@ -475,17 +475,17 @@ fn ensure_struct_fits_in_address_space<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
475475 scapegoat : Ty < ' tcx > ) {
476476 let mut offset = 0 ;
477477 for & llty in fields. iter ( ) {
478- // Invariant: offset < ccx.max_obj_size () <= 1<<61
478+ // Invariant: offset < ccx.obj_size_bound () <= 1<<61
479479 if !packed {
480480 let type_align = machine:: llalign_of_min ( ccx, llty) ;
481481 offset = roundup ( offset, type_align) ;
482482 }
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 ()
485485 // so the sum is less than 1<<62 (and therefore can't overflow).
486486 offset += machine:: llsize_of_alloc ( ccx, llty) ;
487487
488- if offset >= ccx. max_obj_size ( ) {
488+ if offset >= ccx. obj_size_bound ( ) {
489489 ccx. report_overbig_object ( scapegoat) ;
490490 }
491491 }
@@ -504,11 +504,11 @@ fn ensure_enum_fits_in_address_space<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
504504 let discr_size = machine:: llsize_of_alloc ( ccx, ll_inttype ( ccx, discr) ) ;
505505 let ( field_size, field_align) = union_size_and_align ( fields) ;
506506
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
508508 // so the sum is less than 1<<62 (and can't overflow).
509509 let total_size = roundup ( discr_size, field_align) + field_size;
510510
511- if total_size >= ccx. max_obj_size ( ) {
511+ if total_size >= ccx. obj_size_bound ( ) {
512512 ccx. report_overbig_object ( scapegoat) ;
513513 }
514514}
0 commit comments