-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
It is not safe to reinterpret_cast<>
an arbitrary 64-bit value to a DateTime
instance. Among other things, the .NET Framework and .NET Core runtimes do not guarantee that DateTime
structure is backed by a single 64-bit integer field, and the DateTime
type does not guarantee that all possible 64-bit representations are valid.
See offline comment for more details on how to do this safely and reliably.
Ref:
SafePayloadReader/System.Runtime.Serialization.BinaryFormat/Records/SerializationRecord.cs
Line 93 in cfb7ac5
return Unsafe.As<long, DateTime>(ref data); |
adamsitnik
Metadata
Metadata
Assignees
Labels
No labels