[Mono-bugs] [Bug 521671] New: Ungraceful handling of invalid types in catch statment

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jul 13 15:35:28 EDT 2009


           Summary: Ungraceful handling of invalid types in catch statment
    Classification: Mono
           Product: Mono: Compilers
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: mhabersack at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

Code snippet similar to shown below:

---- CUT ----
try {
} catch (ArgumentNullException) {
   // ignore
} catch (ThisClassDoesNotExistException) {
   // ignore
---- CUT ----

Causes mcs to throw exception like:

---- CUT ----
System.Web/HttpApplication.cs(1874,42): error CS0246: The type or namespace
name `BadImageException' could not be found. Are you missing a using directive
or an assembly reference?
Internal compiler error at System.Web/HttpApplication.cs(1865,38):: exception
caught while emitting MethodBuilder [HttpApplication::LoadTypeFromBin]

Unhandled Exception: System.ArgumentNullException: null key
Parameter name: key
  at System.Collections.Hashtable.get_Item (System.Object key) [0x00000] 
  at Mono.CSharp.TypeManager.LookupTypeParameter (System.Type t) [0x00000] 
  at Mono.CSharp.TypeManager.IsSubclassOf (System.Type type, System.Type
base_type) [0x00000] 
  at Mono.CSharp.TryCatch.Resolve (Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.Foreach+ArrayForeach.Resolve (Mono.CSharp.EmitContext ec)
  at Mono.CSharp.Foreach.Resolve (Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext
anonymous_method_host, Mono.CSharp.ToplevelBlock block,
Mono.CSharp.ParametersCompiled ip, IMethodData md, System.Boolean& unreachable)
  at Mono.CSharp.EmitContext.EmitTopBlock (IMethodData md,
Mono.CSharp.ToplevelBlock block) [0x00000] 
  at Mono.CSharp.MethodData.Emit (Mono.CSharp.DeclSpace parent) [0x00000] 
  at Mono.CSharp.MethodOrOperator.Emit () [0x00000] 
  at Mono.CSharp.Method.Emit () [0x00000] 
make[1]: *** [../../class/lib/net_2_0/System.Web.dll] Error 1
make[1]: Leaving directory `/usr/src/tmp/mono/mcs/class/System.Web'
make: *** [do-install] Error 2
---- CUT ----

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list