Search Issue Tracker
Won't Fix
Votes
0
Found in
2018.3.0b2
2018.3.1f1
2019.1.0a1
2019.2.0a1
Issue ID
1117637
Regression
Yes
InvalidProgramException is thrown when calling methods with ref variables referencing an array inside a jagged array
Reproduction steps:
1. Open the attached project "1117637.zip"
2. Open and play "SampleScene"
Expected: Console logs "2" and "10"
Actual: Console logs "2" and throws InvalidProgramException
Reproduced on: 2018.3.0b2, 2018.3.6f1, 2019.1.0b3, 2019.2.0a5
Does not reproduce on: 2018.3.0b1
Could not test on 2017.4 due to C# 6th version Unity restriction
Note:
- Stack trace
InvalidProgramException: Invalid IL code in InvalidILCodeIssue:ResizeUsingRefLocals_CausesException (int): IL_000d: stloc.0
InvalidILCodeIssue.Start () (at Assets/InvalidILCodeIssue.cs:18)
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
- Scene/Game view visually breaks and console is spammed with errors when using DepthBlit Sample Scene
- "GetOrAddComponent" method in "Unity.VisualScripting" returns "MissingComponentException" error when the "BoxCollider" Component doesn't exist
- Render Graphs Kebab Menu Buttons are missing padding and Highlight is uneven when hovered over
- Shader Keywords are not detected when defined in include files
- Right-clicking on Blackboard and Graph Inspector calls the contextual menu of the workspace
Resolution Note:
Issue tracked in Mono: https://github.com/mono/mono/issues/10101
A workaround is to compile your code with "/unsafe". For regular scripts you can enable this in the player settings of your project. The causes mono to avoid the incorrect check.