Add call to IL2CPP_il2cpp_object_unbox in ILGeneratorEx to fix incorrect call for reference value type parameter #243
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a parameter is a reference of
Il2CppSystem.ValueType, the generated code doesn't correctly unboxed, which will let the game or program got a wrong pointer and crash the program. This issue is trying to fix that by callingil2cpp_object_unboxto get actual reference pointer of the value.Only tested on my mod of Taiko no Tatsujin - Rhythm Festival Steam PC version. I don't have enough time for further testing so I don't know whether it will break something or not.
Old interop code generated:
New interop code generated:
The il2cpp method signature from IDA as reference: