[release/9.0-staging] [android] Fix crash in method_to_ir by github-actions[bot] · Pull Request #109510 · dotnet/runtime (original) (raw)
Backport of #109381 to release/9.0-staging
/cc @steveisok
Customer Impact
- Customer reported
- Found internally
A customer was experiencing intermittent crashes with their android app around mono_method_to_ir. After testing multiple iterations, we found there were times when calls to try_prepare_objaddr_callvirt_optimization contained a null reference to a MonoClass. As a result, the app would crash.
To fix, we made a call to mono_class_from_mono_type_internal to make sure we would get a legit MonoClass.
Regression
- Yes
- No
[If yes, specify when the regression was introduced. Provide the PR or commit if known.]
Testing
Manual before and after. After app did not crash.
Risk
Low
IMPORTANT: If this backport is for a servicing release, please verify that:
- The PR target branch is
release/X.0-staging, notrelease/X.0. - If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.