[Mono-bugs] [Bug 470767] New: compiling file leads to exception from gmcs

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jan 29 15:26:33 EST 2009


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


           Summary: compiling file leads to exception from gmcs
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.4.x
          Platform: 32bit
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: basjsmit at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development


Description of Problem:
Trying to compile the moq tests I got an exception from gmcs. Ive reduced the
code that causes the exception to the following. I have tried it with the gmcs
that comes with the 2.4 and 2.2 windows installers. Ive listed the output below
the code (output from 2.4).

Regards, Bas Smit

using System;
using System.Linq.Expressions;
using System.Collections.Generic;

static public class Foo
{
    static public int Helper(Expression<Predicate<int>> match)
    {
        return 0;
    }

    static public void Main()
    {
        Expression<Action<List<int>>> exp = x => x.Add( Helper(i => true) );
    }
}



Exception caught by the compiler while emitting:
   Block that caused the problem begin at: \Solutions\gmcs2\cs\main.cs(13,5):
System.ArgumentNullException: Argument cannot be null.
Parameter name: local
Internal compiler error at \Solutions\gmcs2\cs\main.cs(12,24):: exception
caught
 while emitting MethodBuilder [Foo::Main]

Unhandled Exception: System.ArgumentNullException: Argument cannot be null.
Parameter name: local
  at System.Reflection.Emit.ILGenerator.Emit (OpCode opcode,
System.Reflection.E
mit.LocalBuilder local) [0x00000]
  at Mono.CSharp.LocalInfo.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.VariableReference.EmitLoad (Mono.CSharp.EmitContext ec)
[0x0000
0]
  at Mono.CSharp.VariableReference.Emit (Mono.CSharp.EmitContext ec, Boolean
lea
ve_copy) [0x00000]
  at Mono.CSharp.VariableReference.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.ArrayCreation.EmitDynamicInitializers (Mono.CSharp.EmitContext
ec, Boolean emitConstants) [0x00000]
  at Mono.CSharp.ArrayCreation.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.Argument.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.Invocation.EmitArguments (Mono.CSharp.EmitContext ec,
System.Co
llections.ArrayList arguments, Boolean dup_args, Mono.CSharp.LocalTemporary
this
_arg) [0x00000]
  at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec, Boolean
is_bas
e, Mono.CSharp.Expression instance_expr, System.Reflection.MethodBase method,
Sy
stem.Collections.ArrayList Arguments, Location loc, Boolean dup_args, Boolean
om
it_args) [0x00000]
  at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec, Boolean
is_bas
e, Mono.CSharp.Expression instance_expr, System.Reflection.MethodBase method,
Sy
stem.Collections.ArrayList Arguments, Location loc) [0x00000]
  at Mono.CSharp.MethodGroupExpr.EmitCall (Mono.CSharp.EmitContext ec,
System.Co
llections.ArrayList arguments) [0x00000]
  at Mono.CSharp.Invocation.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.TypeCast.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.Argument.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.Invocation.EmitArguments (Mono.CSharp.EmitContext ec,
System.Co
llections.ArrayList arguments, Boolean dup_args, Mono.CSharp.LocalTemporary
this
_arg) [0x00000]
  at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec, Boolean
is_bas
e, Mono.CSharp.Expression instance_expr, System.Reflection.MethodBase method,
Sy
stem.Collections.ArrayList Arguments, Location loc, Boolean dup_args, Boolean
om
it_args) [0x00000]
  at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec, Boolean
is_bas
e, Mono.CSharp.Expression instance_expr, System.Reflection.MethodBase method,
Sy
stem.Collections.ArrayList Arguments, Location loc) [0x00000]
  at Mono.CSharp.MethodGroupExpr.EmitCall (Mono.CSharp.EmitContext ec,
System.Co
llections.ArrayList arguments) [0x00000]
  at Mono.CSharp.Invocation.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.TypeCast.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.ArrayCreation.EmitDynamicInitializers (Mono.CSharp.EmitContext
ec, Boolean emitConstants) [0x00000]
  at Mono.CSharp.ArrayCreation.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.Argument.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.Invocation.EmitArguments (Mono.CSharp.EmitContext ec,
System.Co
llections.ArrayList arguments, Boolean dup_args, Mono.CSharp.LocalTemporary
this
_arg) [0x00000]
  at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec, Boolean
is_bas
e, Mono.CSharp.Expression instance_expr, System.Reflection.MethodBase method,
Sy
stem.Collections.ArrayList Arguments, Location loc, Boolean dup_args, Boolean
om
it_args) [0x00000]
  at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec, Boolean
is_bas
e, Mono.CSharp.Expression instance_expr, System.Reflection.MethodBase method,
Sy
stem.Collections.ArrayList Arguments, Location loc) [0x00000]
  at Mono.CSharp.MethodGroupExpr.EmitCall (Mono.CSharp.EmitContext ec,
System.Co
llections.ArrayList arguments) [0x00000]
  at Mono.CSharp.Invocation.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.TypeCast.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.ArrayCreation.EmitDynamicInitializers (Mono.CSharp.EmitContext
ec, Boolean emitConstants) [0x00000]
  at Mono.CSharp.ArrayCreation.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.Argument.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.Invocation.EmitArguments (Mono.CSharp.EmitContext ec,
System.Co
llections.ArrayList arguments, Boolean dup_args, Mono.CSharp.LocalTemporary
this
_arg) [0x00000]
  at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec, Boolean
is_bas
e, Mono.CSharp.Expression instance_expr, System.Reflection.MethodBase method,
Sy
stem.Collections.ArrayList Arguments, Location loc, Boolean dup_args, Boolean
om
it_args) [0x00000]
  at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec, Boolean
is_bas
e, Mono.CSharp.Expression instance_expr, System.Reflection.MethodBase method,
Sy
stem.Collections.ArrayList Arguments, Location loc) [0x00000]
  at Mono.CSharp.MethodGroupExpr.EmitCall (Mono.CSharp.EmitContext ec,
System.Co
llections.ArrayList arguments) [0x00000]
  at Mono.CSharp.Invocation.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.TypeCast.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.Argument.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.Invocation.EmitArguments (Mono.CSharp.EmitContext ec,
System.Co
llections.ArrayList arguments, Boolean dup_args, Mono.CSharp.LocalTemporary
this
_arg) [0x00000]
  at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec, Boolean
is_bas
e, Mono.CSharp.Expression instance_expr, System.Reflection.MethodBase method,
Sy
stem.Collections.ArrayList Arguments, Location loc, Boolean dup_args, Boolean
om
it_args) [0x00000]
  at Mono.CSharp.Invocation.EmitCall (Mono.CSharp.EmitContext ec, Boolean
is_bas
e, Mono.CSharp.Expression instance_expr, System.Reflection.MethodBase method,
Sy
stem.Collections.ArrayList Arguments, Location loc) [0x00000]
  at Mono.CSharp.MethodGroupExpr.EmitCall (Mono.CSharp.EmitContext ec,
System.Co
llections.ArrayList arguments) [0x00000]
  at Mono.CSharp.Invocation.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.VariableReference.EmitAssign (Mono.CSharp.EmitContext ec,
Mono.
CSharp.Expression source, Boolean leave_copy, Boolean prepare_for_load)
[0x00000
]
  at Mono.CSharp.Assign.Emit (Mono.CSharp.EmitContext ec, Boolean is_statement)
[0x00000]
  at Mono.CSharp.Assign.EmitStatement (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.StatementExpression.DoEmit (Mono.CSharp.EmitContext ec)
[0x0000
0]
  at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.Block.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.ToplevelBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.EmitContext.EmitResolvedTopBlock (Mono.CSharp.ToplevelBlock
blo
ck, Boolean unreachable) [0x00000]
  at Mono.CSharp.EmitContext.EmitTopBlock (IMethodData md,
Mono.CSharp.ToplevelB
lock block) [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