You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[jnimarshalmethod-gen] Fix type resolution crash (#706)
The TypeMover was crashing, when we cannot resolve the type during
register method optimization.
Like this:
Value cannot be null.
Parameter name: key
System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) [0x00175] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/debug/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/Dictionary.cs:470
at System.Collections.Generic.Dictionary`2[TKey,TValue].ContainsKey (TKey key) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/debug/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/Dictionary.cs:286
at Xamarin.Android.Tools.JniMarshalMethodGenerator.TypeMover.Resolve (Mono.Cecil.TypeReference type) [0x00001] in /Users/rodo/git/xa-clean/external/Java.Interop/tools/jnimarshalmethod-gen/TypeMover.cs:143
at Xamarin.Android.Tools.JniMarshalMethodGenerator.TypeMover.GetActionConstructor (Mono.Cecil.TypeReference type, Mono.Cecil.ModuleDefinition module) [0x00012] in /Users/rodo/git/xa-clean/external/Java.Interop/tools/jnimarshalmethod-gen/TypeMover.cs:335
at Xamarin.Android.Tools.JniMarshalMethodGenerator.TypeMover.AnalyzeAndImprove (Mono.Collections.Generic.Collection`1[T] instructions, Mono.Collections.Generic.Collection`1[T] newInstructions, System.Int32 idx, System.String typeName, System.Int32& skipCount, Mono.Cecil.ModuleDefinition module) [0x003b6] in /Users/rodo/git/xa-clean/external/Java.Interop/tools/jnimarshalmethod-gen/TypeMover.cs:417
The tool was crashing on IL like this:
IL_0122: ldstr "Delegate18$1"
IL_0127: ldc.i4.1
IL_0128: call [mscorlib]System.Type [mscorlib]System.Type::GetType(string,
bool)
The fix makes us more error resistant. It doesn't fix the source of the problem,
which will be fixed elsewhere.
More information about the issue which led to the crash: #709
0 commit comments