[Mono-bugs] [Bug 79451][Maj] New - compiler crash when property name matches privatescope field name

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Sep 20 06:23:41 EDT 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by jeroen at sumatra.nl.

http://bugzilla.ximian.com/show_bug.cgi?id=79451

--- shadow/79451	2006-09-20 06:23:41.000000000 -0400
+++ shadow/79451.tmp.27828	2006-09-20 06:23:41.000000000 -0400
@@ -0,0 +1,105 @@
+Bug#: 79451
+Product: Mono: Compilers
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: jeroen at sumatra.nl               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: compiler crash when property name matches privatescope field name
+
+Given the library assembly:
+
+.assembly extern mscorlib {}
+.assembly TestLib {}
+.module TestLib.dll
+.imagebase 0x00400000
+.subsystem 0x00000003
+.file alignment 512
+.corflags 0x00000001
+
+.class public auto ansi beforefieldinit TestLib
+       extends [mscorlib]System.Object
+{
+  .field static privatescope int32 FOO
+
+  .method public hidebysig specialname static int32
+          get_FOO() cil managed
+  {
+    ldsfld      int32 TestLib::FOO
+    ret
+  }
+
+  .property int32 FOO()
+  {
+    .get int32 TestLib::get_FOO()
+  }
+}
+
+And the C# application:
+
+public class Test
+{
+   public static void Main()
+   {
+      System.Console.WriteLine(TestLib.FOO);
+   }
+}
+
+When you compile the C# application with mcs you get an exception:
+
+C:\mcsbug>mcs test.cs -r:testlib.dll
+Exception caught by the compiler while compiling:
+   Block that caused the problem begin at: test.cs(3,23):
+                     Block being compiled: [test.cs(4,4):,test.cs(6,4):]
+System.ArrayTypeMismatchException: (Types: 
+source=System.Reflection.MemberInfo;  target=System.Reflection.MethodBase)
+
+Unhandled Exception: System.ArrayTypeMismatchException: (Types: 
+source=System.Reflection.MemberInfo;  target=System.Reflection.MethodBase)
+  at System.Array.Copy (System.Array sourceArray, Int32 sourceIndex, 
+System.Array destinationArray, Int32 destinationIndex, Int32 length) 
+[0x00000]
+  at System.Array.CopyTo (System.Array array, Int32 index) [0x00000]
+  at Mono.CSharp.MethodGroupExpr..ctor (System.Reflection.MemberInfo[] 
+mi, Location l) [0x00000]
+  at Mono.CSharp.Expression.MemberLookup (System.Type container_type, 
+System.Type qualifier_type, System.Type queried_type, System.String name, 
+MemberTypes mt, BindingFlags bf, Location loc) [0x00000]
+  at Mono.CSharp.Expression.MemberLookupFinal (Mono.CSharp.EmitContext 
+ec, System.Type qualifier_type, System.Type queried_type, System.String 
+name, MemberTypes mt, BindingFlags bf, Location loc) [0x00000]
+  at Mono.CSharp.Expression.MemberLookupFinal (Mono.CSharp.EmitContext 
+ec, System.Type qualifier_type, System.Type queried_type, System.String 
+name, Location loc) [0x00000]
+  at Mono.CSharp.MemberAccess.DoResolve (Mono.CSharp.EmitContext ec, 
+Mono.CSharp.Expression right_side) [0x00000]
+  at Mono.CSharp.MemberAccess.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.Argument.Resolve (Mono.CSharp.EmitContext ec, Location 
+loc) [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]


More information about the mono-bugs mailing list