[Mono-bugs] [Bug 80643][Wis] New - Exception filter instructions cannot be emitted

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Jan 27 05:29:28 EST 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by nazgul at omega.pl.

http://bugzilla.ximian.com/show_bug.cgi?id=80643

--- shadow/80643	2007-01-27 05:29:28.000000000 -0500
+++ shadow/80643.tmp.7632	2007-01-27 05:29:28.000000000 -0500
@@ -0,0 +1,89 @@
+Bug#: 80643
+Product: Mono: Class Libraries
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: nazgul at omega.pl               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Exception filter instructions cannot be emitted
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+Cannot emit exception filter clause side by side with normal handlers
+
+Steps to reproduce the problem:
+1. Compile and run
+
+using System;
+using System.Threading;
+using System.Reflection;
+using System.Reflection.Emit;
+
+class TestBuilder {
+  public static void Main() {
+   Type[] ctorParams = new Type[] {};
+   AppDomain myDomain = Thread.GetDomain();
+   AssemblyName myAsmName = new AssemblyName();
+   myAsmName.Name = "MyDynamicAssembly";
+   AssemblyBuilder myAsmBuilder = myDomain.DefineDynamicAssembly(
+     myAsmName,
+     AssemblyBuilderAccess.RunAndSave);
+   ModuleBuilder pointModule =
+myAsmBuilder.DefineDynamicModule("PointModule",  "Point.dll");
+   TypeBuilder pointTypeBld = pointModule.DefineType("Point",
+TypeAttributes.Public);
+
+   ConstructorBuilder pointCtor =
+pointTypeBld.DefineConstructor(MethodAttributes.Public |
+MethodAttributes.RTSpecialName, CallingConventions.Standard, ctorParams);
+   ILGenerator il = pointCtor.GetILGenerator ();
+   
+   Label endOfMthd = il.DefineLabel();
+
+   Label exBlock = il.BeginExceptionBlock();
+
+   il.ThrowException(typeof(OverflowException));
+
+   il.BeginExceptFilterBlock ();
+   
+   il.Emit (OpCodes.Isinst, typeof(OverflowException));
+   il.Emit (OpCodes.Brfalse, endOfMthd);
+   
+   il.BeginCatchBlock(null);
+   
+   il.BeginCatchBlock(typeof(Exception));
+
+
+   il.EndExceptionBlock();
+
+   il.MarkLabel (endOfMthd);
+   
+   pointTypeBld.CreateType();
+ }
+}
+
+Actual Results:
+Unhandled Exception: System.ArgumentException: Do not supply an exception
+type for filter clause
+  at System.Reflection.Emit.ILGenerator.BeginCatchBlock (System.Type
+exceptionType) [0x00000] 
+  at TestBuilder.Main () [0x00000] 
+
+
+Expected Results:
+Clear run
+
+How often does this happen? 
+
+
+Additional Information:


More information about the mono-bugs mailing list