You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some DataLayout objects have constructors that allow for backing arrays with dimensions that don't match what one would expect given the stored types.
e.g.
FT = Float64
S = Complex{FT}
vf1 = VF{S}(Matrix{FT}, 3)
vf2 = VF{S}(ones(3, 7))
Here, vf1 generates a VF struct with a backing array of the expected size (3 x 2 as v = 3 and complex components need two elements). However, vf2 also works and creates a backing array with size 3 x 7; in this case, more than half of this stored data is inaccessible and unused.
We can add a typesize check in the bugged constructor to prevent this. The other DataLayout constructors should be reviewed for similar issues.
The text was updated successfully, but these errors were encountered:
Some
DataLayout
objects have constructors that allow for backing arrays with dimensions that don't match what one would expect given the stored types.e.g.
Here,
vf1
generates aVF
struct with a backing array of the expected size (3 x 2 as v = 3 and complex components need two elements). However,vf2
also works and creates a backing array with size 3 x 7; in this case, more than half of this stored data is inaccessible and unused.We can add a
typesize
check in the bugged constructor to prevent this. The otherDataLayout
constructors should be reviewed for similar issues.The text was updated successfully, but these errors were encountered: