Bugzilla – Bug 318103
reflection: empty exception blocks cause mono to crash
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by dsilva@ccs.neu.edu 2005-05-28 02:30:08 MST ---- Description of Problem: In this sample program, ignore the scaffolding and just look at the two ILGenerator method calls. using System; using System.Reflection; using System.Reflection.Emit; public class App { public static void Main() { const string outfile = "test-outfile.exe"; AssemblyName name = new AssemblyName(); name.Name = "MyDynamicAssembly"; AssemblyBuilder asm = AppDomain.CurrentDomain.DefineDynamicAssembly(name, AssemblyBuilderAccess.Save); ModuleBuilder mod = asm.DefineDynamicModule("MyModule", outfile, true); TypeBuilder type = mod.DefineType("MyType", TypeAttributes.Public, typeof(object), Type.EmptyTypes); MethodBuilder method = type.DefineMethod("mymethod", MethodAttributes.Public, typeof(void), Type.EmptyTypes); ILGenerator il = method.GetILGenerator(); il.BeginExceptionBlock(); il.EndExceptionBlock(); type.CreateType(); } } $ mcs -debug exn-block.cs $ mono --debug exn-block.exe ** ERROR **: file reflection.c: line 835 (method_encode_clauses): assertion failed: (ex_info->handlers) aborting... Aborted $ ---- Additional Comments From vargaz@gmail.com 2005-05-30 07:46:00 MST ---- Empty exceptions blocks are not valid IL, MS.NET detects this, we do not. *** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO74923 *** Unknown operating system unknown. Setting to default OS "Other". This bug was marked DUPLICATE in the database it was moved from. Changing resolution to "MOVED"