[Mono-bugs] [Bug 336651] New: Crash compiling anonymous method

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Oct 25 05:19:19 EDT 2007


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

           Summary: Crash compiling anonymous method
           Product: Mono: Compilers
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: rharinath at novell.com
        ReportedBy: sanxiyn at gmail.com
         QAContact: mono-bugs at ximian.com
          Found By: ---


mcs (r88110) crashes compiling the following code. The same code compiles with
Mono 1.2.5.

The code was reduced from IronPython 2.0 Alpha 1.

public class test {
    public delegate bool UnaryOperator(object self, out object res);
    public void AddOperator(UnaryOperator target) {}
    public bool TryGetValue(object self, out object value) {
        value = null;
        return false;
    }
    public void PublishOperators() {
        AddOperator(
            delegate(object self, out object res) {
                object value;
                if (TryGetValue(self, out value)) {
                    res = value;
                    if (res != null) return true;
                }
                res = null;
                return false;
            }
        );
    }
}

Unhandled Exception: Mono.CSharp.InternalErrorException: test.cs(10,13):
  ---> System.NullReferenceException: Object reference not set to an instance
of an object
  at Mono.CSharp.FlowBranching+UsageVector.IsAssigned (Mono.CSharp.VariableInfo
var, Boolean ignoreReachability) [0x00000] 
  at Mono.CSharp.FlowBranching.IsAssigned (Mono.CSharp.VariableInfo vi)
[0x00000] 
  at Mono.CSharp.ParameterReference.IsAssigned (Mono.CSharp.EmitContext ec,
Location loc) [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.Binary.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.Expression.ResolveBoolean (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression e, Location loc) [0x00000] 
  at Mono.CSharp.If.Resolve (Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000] 
  at Mono.CSharp.If.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 delegateType) [0x00000] 
  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.IsApplicable (Mono.CSharp.EmitContext ec,
System.Collections.ArrayList arguments, Int32 arg_count,
System.Reflection.MethodBase& method) [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.


More information about the mono-bugs mailing list