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
SR-7726 Data.withUnsafe(Mutable)Bytes should use bindMemory(to:) instead of assumingMemoryBound(to:)
SR-7850DataStorage's set(:) method should use storeBytes(of:toByteOffset:as:)
Issue Description:
Currently _DataStorage's get(_:) method uses assumingMemoryBound(to:), which can invoke undefined behaviour if the underlying memory is bound to a type unrelated to UInt8.
Additional Detail from JIRA
md5: 95afe395044a05b79f001ba200709f2b
relates to:
Issue Description:
Currently
_DataStorage
'sget(_:)
method usesassumingMemoryBound(to:)
, which can invoke undefined behaviour if the underlying memory is bound to a type unrelated toUInt8
.We should use
load(fromByteOffset:as:)
instead.For more context, see https://forums.swift.org/t/how-to-use-data-withunsafebytes-in-a-well-defined-manner/12811.
The text was updated successfully, but these errors were encountered: