[Mono-bugs] [Bug 424879] New: mcs crashes whene compiling delegate

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Sep 9 14:14:34 EDT 2008


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


           Summary: mcs crashes whene compiling delegate
           Product: Mono: Compilers
           Version: 1.9
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: verdier.jean at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development


public delegate C C1(C c);

  public class C { }

  public class A {
    public static C B(C1 c) { return(null); }
  }

  public class Main {
    public static C f = A.B(delegate(C x) { return A.B(delegate(C y) {
return(x); }); });
    //public static C f;
    //static Main() {
    //  f = A.B(delegate(C x) { return A.B(delegate(C y) { return(x); }); });
    //}
  }

The commented code compiles with no error.
The uncommented code result in:

Exception caught by the compiler while compiling:
   Block that caused the problem begin at: Bug.cs(13,56):
                     Block being compiled: [Bug.cs(13,70):,Bug.cs(13,83):]
System.NullReferenceException: Object reference not set to an instance of an
object
Exception caught by the compiler while compiling:
   Block that caused the problem begin at: Bug.cs(13,29):
                     Block being compiled: [Bug.cs(13,43):,Bug.cs(13,87):]
Mono.CSharp.InternalErrorException: Bug.cs(13,56):

Unhandled Exception: Mono.CSharp.InternalErrorException: Bug.cs(13,29): --->
Mono.CSharp.InternalErrorException: Bug.cs(13,56): --->
System.NullReferenceException: Object reference not set to an instance of an
object
  at Mono.CSharp.CompilerGeneratedClass..ctor (Mono.CSharp.DeclSpace parent,
Mono.CSharp.MemberName name, Int32 mod, Location loc) [0x00000] 
  at Mono.CSharp.CompilerGeneratedClass..ctor (Mono.CSharp.DeclSpace parent,
Mono.CSharp.GenericMethod generic, Int32 mod, Location loc) [0x00000] 
  at Mono.CSharp.ScopeInfo..ctor (Mono.CSharp.Block block,
Mono.CSharp.DeclSpace parent, Mono.CSharp.GenericMethod generic) [0x00000] 
  at Mono.CSharp.ScopeInfo.CreateScope (Mono.CSharp.Block block) [0x00000] 
  at Mono.CSharp.Block.CreateScopeInfo () [0x00000] 
  at Mono.CSharp.ParameterReference.DoResolveBase (Mono.CSharp.EmitContext ec)
[0x00000] 
  at Mono.CSharp.ParameterReference.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.SimpleName.DoSimpleNameResolve (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression right_side, Boolean intermediate) [0x00000] 
  at Mono.CSharp.SimpleName.SimpleNameResolve (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression right_side, Boolean intermediate) [0x00000] 
  at Mono.CSharp.SimpleName.DoResolve (Mono.CSharp.EmitContext ec, Boolean
intermediate) [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.Return.DoResolve (Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.Return.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] --- End of inner
exception stack trace ---

  at Mono.CSharp.AnonymousMethodExpression.Compatible (Mono.CSharp.EmitContext
ec, System.Type type) [0x00000] 
  at Mono.CSharp.Convert.ImplicitConversionStandard (Mono.CSharp.EmitContext
ec, Mono.CSharp.Expression expr, System.Type target_type, Location loc)
[0x00000] 
  at Mono.CSharp.Convert.ImplicitConversion (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression expr, System.Type target_type, Location loc) [0x00000] 
  at Mono.CSharp.MethodGroupExpr.VerifyArgumentsCompat (Mono.CSharp.EmitContext
ec, System.Collections.ArrayList& arguments, Int32 arg_count,
System.Reflection.MethodBase method, Boolean chose_params_expanded, Boolean
may_fail, Location loc) [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.Return.DoResolve (Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.Return.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] --- End of inner
exception stack trace ---

  at Mono.CSharp.AnonymousMethodExpression.Compatible (Mono.CSharp.EmitContext
ec, System.Type type) [0x00000] 
  at Mono.CSharp.Convert.ImplicitConversionStandard (Mono.CSharp.EmitContext
ec, Mono.CSharp.Expression expr, System.Type target_type, Location loc)
[0x00000] 
  at Mono.CSharp.Convert.ImplicitConversion (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression expr, System.Type target_type, Location loc) [0x00000] 
  at Mono.CSharp.MethodGroupExpr.VerifyArgumentsCompat (Mono.CSharp.EmitContext
ec, System.Collections.ArrayList& arguments, Int32 arg_count,
System.Reflection.MethodBase method, Boolean chose_params_expanded, Boolean
may_fail, Location loc) [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.Assign.DoResolve (Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.FieldInitializer.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.TypeContainer.DoResolveFieldInitializers
(Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.TypeContainer.ResolveFieldInitializers
(Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.Constructor.Emit () [0x00000] 
  at Mono.CSharp.TypeContainer.EmitType () [0x00000] 
  at Mono.CSharp.RootContext.EmitCode () [0x00000] 
  at Mono.CSharp.Driver.MainDriver (System.String[] args) [0x00000] 
  at Mono.CSharp.Driver.Main (System.String[] args) [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