+2008-09-23 Marek Safar <marek.safar@gmail.com>
+
+ * ModuleBuilder.cs: Fixed NRE when default symbol writer cannot be
+ loaded.
+
2008-09-16 Jb Evain <jbevain@novell.com>
* AssemblyBuilder.cs (AddTypeForwarder): correctly grow the
if (emitSymbolInfo) {
Assembly asm = Assembly.LoadWithPartialName ("Mono.CompilerServices.SymbolWriter");
+ if (asm == null)
+ throw new ExecutionEngineException ("The assembly for default symbol writer cannot be loaded");
+
Type t = asm.GetType ("Mono.CompilerServices.SymbolWriter.SymbolWriterImpl");
- if (t != null) {
- symbolWriter = (ISymbolWriter) Activator.CreateInstance (t, new object[] { this });
- string fileName = fqname;
- if (assemblyb.AssemblyDir != null)
- fileName = Path.Combine (assemblyb.AssemblyDir, fileName);
- symbolWriter.Initialize (IntPtr.Zero, fileName, true);
- }
+ if (t == null)
+ throw new ExecutionEngineException ("The type that implements the default symbol writer interface cannot be found");
+
+ symbolWriter = (ISymbolWriter) Activator.CreateInstance (t, new object[] { this });
+ string fileName = fqname;
+ if (assemblyb.AssemblyDir != null)
+ fileName = Path.Combine (assemblyb.AssemblyDir, fileName);
+ symbolWriter.Initialize (IntPtr.Zero, fileName, true);
}
}