[Mono-bugs] [Bug 361457] New: mcs error reporting crash

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Feb 13 08:27:25 EST 2008


           Summary: mcs error reporting crash
           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: dick at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

Compiling this code snippet:

using System;

public class foo {
        static int intval = 3;

        public static void voidfunc() {
                // do nothing

        public static void Main() {
                Console.WriteLine ("Whoops: {0} {1}", intval, voidfunc());

results in this crash:

foo.cs(12,25): error CS1502: The best overloaded method match for
`System.Console.WriteLine(string, params object[])' has some invalid arguments
/home/dick/mono/install/lib/mono/1.0/mscorlib.dll (Location of the symbol
related to previous error)
Exception caught by the compiler while compiling:
   Block that caused the problem begin at: foo.cs(11,28):
                     Block being compiled: [foo.cs(11,35):,foo.cs(13,9):]
System.IndexOutOfRangeException: Array index is out of range.
Internal compiler error at foo.cs(11,28):: exception caught while emitting
MethodBuilder [foo::Main]

Unhandled Exception: System.IndexOutOfRangeException: Array index is out of
  at Mono.CSharp.ReflectionParameters.ParameterModifier (Int32 pos) [0x00000] 
  at Mono.CSharp.MethodGroupExpr.Error_InvalidArguments
(Mono.CSharp.EmitContext ec, Location loc, Int32 idx,
System.Reflection.MethodBase method, Mono.CSharp.Argument a, ParameterData
expected_par, System.Type paramType) [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)
  at Mono.CSharp.Invocation.DoResolveOverload (Mono.CSharp.EmitContext ec)
  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)
  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]

Removing the 'intval' parameter to WriteLine removes the crash too.

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