The two modified methods (InitAliasing and InitUAV) don't zero initialize the result due to Unsafe.SkipInit(). This makes sense due to the union field (Aliasing) but it means it is possible to accidentally return uninitialized stack memory -- and this is exactly what is happening with the Flags field.
The two modified methods (
InitAliasing
andInitUAV
) don't zero initialize the result due toUnsafe.SkipInit()
. This makes sense due to the union field (Aliasing
) but it means it is possible to accidentally return uninitialized stack memory -- and this is exactly what is happening with theFlags
field.