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
The safe method as_object_id used transmute to convert &ChunkId to &ObjectId. When we use transmute on reference, we need to ensure the layout (e.g., size and alignment) by ourselves. Even though ChunkId and ObjectId have the same type definition, rust compiler preserves the right to reorder and add padding bytes to the struct of repr(Rust) representation. Suggest to add repr(C) to both struct to make this guarantee.
The text was updated successfully, but these errors were encountered:
CYFS/src/component/cyfs-base/src/objects/chunk.rs
Lines 157 to 159 in 9eaf33f
The safe method
as_object_id
usedtransmute
to convert&ChunkId
to&ObjectId
. When we usetransmute
on reference, we need to ensure the layout (e.g., size and alignment) by ourselves. Even thoughChunkId
andObjectId
have the same type definition, rust compiler preserves the right to reorder and add padding bytes to the struct ofrepr(Rust)
representation. Suggest to addrepr(C)
to both struct to make this guarantee.The text was updated successfully, but these errors were encountered: