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
- SerializedPropertyChangeEvent is invoked when initially binding PropertyFields in custom Editor
- UI Panel is not visible when HDR and STP filter are enabled
- Crash on GfxDeviceD3D11Base::DrawBuffersIndirect when opening a specific project
- OnTriggerExit2D is called in Play mode when undoing component adding
- Builds fail with "Execution failed for task ':launcher:checkReleaseDuplicateClasses'" error when the newer version of the In-App Purchasing package is installed on a specific project
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