[Mono-bugs] [Bug 353457] New: Compiler crashes when encountering anonymous method passed to params method

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jan 11 17:35:14 EST 2008


https://bugzilla.novell.com/show_bug.cgi?id=353457


           Summary: Compiler crashes when encountering anonymous method
                    passed to params method
           Product: Mono: Compilers
           Version: 1.2.6
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Blocker
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: abockover at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


I have run into another regression with gmcs 1.2.6.

If an anonymous method is passed to a method that has a params argument, the
compiler will crash.

..
delegate void Handler ();
void Method (Handler handler, params string [] args) { }
Method (delegate { }); // compiler crashes here
..

I will attach a test case. What follows is the exception produced by gmcs. I
have marked the severity of this bug Blocker since I have confirmed it is a
regression in the compiler by testing this case against gmcs 1.2.2 and 1.2.4. I
have not however tested 1.2.5, so this bug may exist in that version as well.

----

aaron at stayclassy:~/svn/banshee/src$ gmcs
params-method-with-anonymous-method-in-call.cs 
Exception caught by the compiler while compiling:
   Block that caused the problem begin at:
params-method-with-anonymous-method-in-call.cs(9,24):
                     Block being compiled:
[params-method-with-anonymous-method-in-call.cs(10,5):,params-method-with-anonymous-method-in-call.cs(18,5):]
System.NullReferenceException: Object reference not set to an instance of an
object
Internal compiler error at
params-method-with-anonymous-method-in-call.cs(9,24):: exception caught while
emitting MethodBuilder [Thing::Main]

Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
  at Mono.CSharp.AnonymousMethodExpression.ImplicitStandardConversionExists
(System.Type delegate_type) [0x00000] 
  at Mono.CSharp.Convert.ImplicitStandardConversionExists
(Mono.CSharp.Expression expr, System.Type target_type) [0x00000] 
  at Mono.CSharp.Convert.ImplicitConversionExists (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression expr, System.Type target_type) [0x00000] 
  at Mono.CSharp.MethodGroupExpr.IsParamsMethodApplicable
(Mono.CSharp.EmitContext ec, System.Collections.ArrayList arguments, Int32
arg_count, System.Reflection.MethodBase candidate, Boolean do_varargs)
[0x00000] 
  at Mono.CSharp.MethodGroupExpr.IsParamsMethodApplicable
(Mono.CSharp.EmitContext ec, System.Collections.ArrayList arguments, Int32
arg_count, Boolean do_varargs, System.Reflection.MethodBase& candidate)
[0x00000] 
  at Mono.CSharp.MethodGroupExpr.IsParamsMethodApplicable
(Mono.CSharp.EmitContext ec, System.Collections.ArrayList arguments, Int32
arg_count, System.Reflection.MethodBase& candidate) [0x00000] 
  at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.EmitContext ec,
System.Collections.ArrayList Arguments, Boolean may_fail, Location loc)
[0x00000] 
  at Mono.CSharp.Invocation.DoResolveOverload (Mono.CSharp.EmitContext ec)
[0x00000] 
  at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags
flags) [0x00000] 
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.EmitContext
ec) [0x00000] 
  at Mono.CSharp.StatementExpression.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.Parameters
ip, IMethodData md, System.Boolean& unreachable) [0x00000]


-- 
Configure bugmail: https://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