Search Issue Tracker
Fixed in 2022.1.X
Fixed in 2019.4.X, 2020.3.X, 2021.1.X, 2021.2.X
Votes
0
Found in
2018.4
2019.4
2020.3
2020.3.11f1
2021.1
2021.2
2022.1
Issue ID
1346805
Regression
No
Marshal.OffsetOf() returns incorrect offset when building the project with IL2CPP Scripting Backend
Reproduction steps:
1. Open the attached project ("IL2CppAlignmentBug.zip")
2. Open the "SampleScene" scene: Project window > Assets > Scenes > "SampleScene.assets"
3. Enter the Play-Mode, inspect the "offset" value printed in the Game window
4. Set the Scripting Backend as IL2CPP: Edit > Project Settings > Player > Other Settings
5. Build the project: File > Build Settings > Build And Run
Expected result: The Marshal.OffsetOf() method returns offset of 8 when project is built with IL2CPP Scripting Backend
Actual result: The Marshal.OffsetOf() method returns offset of 4 when project is built with IL2CPP Scripting Backend
Reproducible with: 2018.4.36f1, 2019.4.29f1, 2020.3.14f1, 2021.1.14f1, 2021.2.0b3, 2022.1.0a1
Note:
- Not reproducible with Mono Scripting Backend
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (fix version 2022.1):
Fixed in: 2022.1.0a3
Resolution Note (fix version 2021.2):
Fixed in: 2021.2.0b7
Resolution Note (fix version 2021.1):
Fixed in: 2021.1.17f1
Resolution Note (fix version 2020.3):
Fixed in: 2020.3.20f1
Resolution Note (fix version 2019.4):
Fixed in: 2019.4.31f1