File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -577,12 +577,17 @@ void jl_compute_field_offsets(jl_datatype_t *st)
577577                    // Should never happen 
578578                    throw_ovf (should_malloc , desc , st , fsz );
579579                desc [i ].isptr  =  0 ;
580+ 
580581                if  (jl_is_uniontype (fld )) {
581582                    haspadding  =  1 ;
582583                    fsz  +=  1 ; // selector byte 
583584                    zeroinit  =  1 ;
584585                }
585586                else  {
587+                     if  (fsz  >  jl_datatype_size (fld )) {
588+                         // We have to pad the size to integer size class, but it means this has some padding 
589+                         haspadding  =  1 ;
590+                     }
586591                    uint32_t  fld_npointers  =  ((jl_datatype_t * )fld )-> layout -> npointers ;
587592                    if  (((jl_datatype_t * )fld )-> layout -> haspadding )
588593                        haspadding  =  1 ;
Original file line number Diff line number Diff line change @@ -8085,3 +8085,9 @@ let widen_diagonal(x::UnionAll) = Base.rewrap_unionall(Base.widen_diagonal(Base.
80858085    @test  Tuple ===  widen_diagonal (Union{Tuple{Vararg{S}}, Tuple{Vararg{T}}} where  {S, T})
80868086    @test  Tuple{Vararg{Val{<: Set }}} ==  widen_diagonal (Tuple{Vararg{T}} where  T<: Val{<:Set} )
80878087end 
8088+ 
8089+ # 58434 bitsegal comparison of oddly sized fields
8090+ primitive type  ByteString58434 (18  *  8 ) end 
8091+ 
8092+ @test  Base. datatype_isbitsegal (Tuple{ByteString58434}) ==  false 
8093+ @test  Base. datatype_haspadding (Tuple{ByteString58434}) ==  true 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments