Reproduction steps:
1. Open the attached “repro-project”
2. Make sure that the Scripting Backend is set to IL2CPP
3. Build And Run
Expected result: IsGenericTypeParameter returns true or false without causing a crash
Actual result: The Player crashes when IsGenericTypeParameter is called on an unbound type
Reproducible with: 2021.3.32f1, 2022.3.13f1, 2023.1.20f1, 2023.2.0f1, 2023.3.0a14
Reproduced on: Windows 10 Pro
Not reproducible on: No other environment tested
Notes:
1. Not reproducible when entering Play Mode in the Editor
2. Not reproducible with Mono Scripting Backend
3. The crash specifically occurs when IsGenericTypeParameter is called on the first generic argument of an unbound generic type, such as Dictionary<,>. This issue is observed with types that are unbound or have unspecified generic parameters
4. The crash is not observed when IsGenericTypeParameter is used on non-generic types (e.g., typeof(int)) or on fully bound generic types (e.g., typeof(Dictionary<int,int>))
First few lines of the stack trace:
0x00007FFD9A27FE5C (GameAssembly) Type_get_IsGenericTypeParameter_m64B33CA8A518C68B58352CE3D66C2B0774292C4C
0x00007FFD9A0133C9 (GameAssembly) TestTypeStuff_Start_m30BB65A6B02CC3AD25EFD6DF0C7FEE1E34731B63
0x00007FFD99FAFC56 (GameAssembly) il2cpp::vm::Runtime::InvokeWithThrow
0x00007FFD99FAF6F9 (GameAssembly) il2cpp::vm::Runtime::Invoke