Bug 318103 (MONO75079) - reflection: empty exception blocks cause mono to crash
Summary: reflection: empty exception blocks cause mono to crash
Status: RESOLVED MOVED
Alias: MONO75079
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-28 09:30 UTC by Daniel Silva
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:19:03 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"