Skip to content

Commit

Permalink
fix CyclePadding(::DataType) (#50719)
Browse files Browse the repository at this point in the history
We probably want to add a test for this code path.

(cherry picked from commit f4cb8bc)
  • Loading branch information
aviatesk authored and IanButterworth committed Aug 19, 2023
1 parent 86f75bf commit 344ef77
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion base/reinterpretarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,9 @@ function CyclePadding(T::DataType)
a, s = datatype_alignment(T), sizeof(T)
as = s + (a - (s % a)) % a
pad = padding(T)
s != as && push!(pad, Padding(s, as - s))
if s != as
pad = Core.svec(pad..., Padding(s, as - s))
end
CyclePadding(pad, as)
end

Expand Down

0 comments on commit 344ef77

Please sign in to comment.