Reproduction steps:
1. Open the attached “IN-91593_SkipLocalsInitTest.zip“ project
2. Open Burst Inspector (Jobs > Burst > Open Inspector…)
3. Select the “BurstTestLargeStructV1“ under the “SkipLocalsInitTest” category
4. Observe
5. Select the “BurstTestLargeStructV2“ under the “SkipLocalsInitTest” category
6. Observe
Expected result: Burst initializes out parameters the same way as return values, stack memory is not cleared
Actual result: Burst is zero-initializing stack memory initialized by the out parameter (BurstTestLargeStructV2)
Reproducible with: 1.8.19 (2022.3.58f1, 6000.0.39f1, 6000.1.0b7, 6000.2.0a4)
Reproducible on: Windows 10 (User’s platform), M1 Max MacOS 15.1.1 (Tested by CQA)
Not reproducible on: No other environment tested
Note:
- This can be worked-around by using the [Unity.Burst.CompilerServices.SkipLocalsInit] attribute, but it shouldn't be necessary here.
- The user thinks that “Unity.Collections.LowLevel.Unsafe.UnsafeUtility” method should be added with the functional equivalence of “System.Runtime.CompilerServices.Unsafe.SkipInit<T>(out T value)”