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)
577
577
// Should never happen
578
578
throw_ovf (should_malloc , desc , st , fsz );
579
579
desc [i ].isptr = 0 ;
580
+
580
581
if (jl_is_uniontype (fld )) {
581
582
haspadding = 1 ;
582
583
fsz += 1 ; // selector byte
583
584
zeroinit = 1 ;
584
585
}
585
586
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
+ }
586
591
uint32_t fld_npointers = ((jl_datatype_t * )fld )-> layout -> npointers ;
587
592
if (((jl_datatype_t * )fld )-> layout -> haspadding )
588
593
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.
8085
8085
@test Tuple === widen_diagonal (Union{Tuple{Vararg{S}}, Tuple{Vararg{T}}} where {S, T})
8086
8086
@test Tuple{Vararg{Val{<: Set }}} == widen_diagonal (Tuple{Vararg{T}} where T<: Val{<:Set} )
8087
8087
end
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