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
- Shader Graph Asset icon is not shown on creation unless you confirm the name
- APV Sky occlusion doesn't consider the terrain
- [iOS] "EXC_BAD_ACCESS" Player crash when Script Debugging is enabled
- Cursor skips input fields when tabbing between two sets of input fields
- "Shader error redefinition of 'Varyings'" error appears when selecting the shader
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