@@ -464,17 +464,17 @@ fn ensure_struct_fits_in_address_space(ccx: &CrateContext,
464464 scapegoat : ty:: t ) {
465465 let mut offset = 0 ;
466466 for & llty in fields. iter ( ) {
467- // Invariant: offset < ccx.max_obj_size () <= 1<<61
467+ // Invariant: offset < ccx.obj_size_bound () <= 1<<61
468468 if !packed {
469469 let type_align = machine:: llalign_of_min ( ccx, llty) ;
470470 offset = roundup ( offset, type_align) ;
471471 }
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 ()
474474 // so the sum is less than 1<<62 (and therefore can't overflow).
475475 offset += machine:: llsize_of_alloc ( ccx, llty) ;
476476
477- if offset >= ccx. max_obj_size ( ) {
477+ if offset >= ccx. obj_size_bound ( ) {
478478 ccx. report_overbig_object ( scapegoat) ;
479479 }
480480 }
@@ -493,11 +493,11 @@ fn ensure_enum_fits_in_address_space(ccx: &CrateContext,
493493 let discr_size = machine:: llsize_of_alloc ( ccx, ll_inttype ( ccx, discr) ) ;
494494 let ( field_size, field_align) = union_size_and_align ( fields) ;
495495
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
497497 // so the sum is less than 1<<62 (and can't overflow).
498498 let total_size = roundup ( discr_size, field_align) + field_size;
499499
500- if total_size >= ccx. max_obj_size ( ) {
500+ if total_size >= ccx. obj_size_bound ( ) {
501501 ccx. report_overbig_object ( scapegoat) ;
502502 }
503503}
0 commit comments