Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

2009-12-08 Sebastien Pouliot <sebastien@ximian.com>

	* Wizard.cs: Don't throw/crash wizard if an unmanaged dll is
	added to the list of assemblies. At the moment the assembly is
	simply ignored.
	[Backport r147897]


svn path=/branches/mono-2-6/mono-tools/; revision=147898
  • Loading branch information...
commit c7e79cd73617536164d00e8f98aa60efebe3c45f 1 parent f6045f0
Sebastien Pouliot authored
View
7 gendarme/swf-wizard-runner/ChangeLog
@@ -1,3 +1,10 @@
+2009-12-08 Sebastien Pouliot <sebastien@ximian.com>
+
+ * Wizard.cs: Don't throw/crash wizard if an unmanaged dll is
+ added to the list of assemblies. At the moment the assembly is
+ simply ignored.
+ [Backport r147897]
+
2009-11-29 Sebastien Pouliot <sebastien@ximian.com>
* GuiRunner.cs: Add Execute method that will catch and report
View
14 gendarme/swf-wizard-runner/Wizard.cs
@@ -37,6 +37,7 @@
using Gendarme.Properties;
using Mono.Cecil;
+using Mono.Cecil.Binary;
namespace Gendarme {
@@ -323,7 +324,13 @@ public void UpdateAssemblies ()
if ((kvp.Value.Definition == null) || (kvp.Value.Timestamp < last_write)) {
AssemblyInfo a = kvp.Value;
a.Timestamp = last_write;
- a.Definition = AssemblyFactory.GetAssembly (kvp.Key);
+ try {
+ a.Definition = AssemblyFactory.GetAssembly (kvp.Key);
+ }
+ catch (ImageFormatException) {
+ // continue loading & analyzing assemblies
+ // TODO: report as non-fatal warning
+ }
}
}
}
@@ -540,7 +547,10 @@ private void PrepareAnalyze ()
Runner.Assemblies.Clear ();
foreach (KeyValuePair<string, AssemblyInfo> kvp in assemblies) {
// add assemblies references to runner
- Runner.Assemblies.Add (kvp.Value.Definition);
+ AssemblyDefinition ad = kvp.Value.Definition;
+ // an invalid assembly (e.g. non-managed code) will be null at this stage
+ if (ad != null)
+ Runner.Assemblies.Add (ad);
}
progress_bar.Maximum = Runner.Assemblies.Count;
Please sign in to comment.
Something went wrong with that request. Please try again.