From bf81f8f27bac94c048c0b0064610053bf892cd6f Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 23 May 2017 15:38:19 +0200 Subject: [PATCH] [mmp] Add unusual checks necessary to process obfuscated code. Fixes #53420. (#2117) https://bugzilla.xamarin.com/show_bug.cgi?id=53420 --- tools/common/Assembly.cs | 3 +++ tools/linker/MonoTouch.Tuner/ListExportedSymbols.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/common/Assembly.cs b/tools/common/Assembly.cs index d4f9f07d12..e71b4ff740 100644 --- a/tools/common/Assembly.cs +++ b/tools/common/Assembly.cs @@ -335,6 +335,9 @@ namespace Xamarin.Bundler { foreach (var mr in m.ModuleReferences) { string name = mr.Name; + if (string.IsNullOrEmpty (name)) + continue; // obfuscated assemblies. + string file = Path.GetFileNameWithoutExtension (name); switch (file) { diff --git a/tools/linker/MonoTouch.Tuner/ListExportedSymbols.cs b/tools/linker/MonoTouch.Tuner/ListExportedSymbols.cs index 6562113840..2594f4eab8 100644 --- a/tools/linker/MonoTouch.Tuner/ListExportedSymbols.cs +++ b/tools/linker/MonoTouch.Tuner/ListExportedSymbols.cs @@ -76,7 +76,7 @@ namespace MonoTouch.Tuner void ProcessMethod (MethodDefinition method) { - if (method.IsPInvokeImpl && method.HasPInvokeInfo) { + if (method.IsPInvokeImpl && method.HasPInvokeInfo && method.PInvokeInfo != null) { var pinfo = method.PInvokeInfo; if (pinfo.Module.Name == "__Internal") DerivedLinkContext.GetRequiredSymbolList (pinfo.EntryPoint).Add (method);