[Mono-bugs] [Bug 60119][Nor] New - gmcs crashes when compiling incorrect code with missing variable name for generic type

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 13 Jun 2004 06:26:08 -0400 (EDT)


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 benmartin@fourthplanet.net.

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

--- shadow/60119	2004-06-13 06:26:08.000000000 -0400
+++ shadow/60119.tmp.19060	2004-06-13 06:26:08.000000000 -0400
@@ -0,0 +1,78 @@
+Bug#: 60119
+Product: Mono: Compilers
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: benmartin@fourthplanet.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: gmcs crashes when compiling incorrect code with missing variable name for generic type
+
+Description of Problem:
+gmcs always crashes with NullReferenceException when compiling (incorrect)
+code with a generic type with object name omitted.
+
+Steps to reproduce the problem:
+Compile this code:
+
+using System.Collections;
+using System.IO;
+using System;
+ 
+public class GenericTest<T> {
+  public GenericTest(T value)
+  {
+    Console.WriteLine(value.ToString());
+  }
+ 
+}
+ 
+public class GenericTestDriver {
+ 
+  static int Main()
+  {
+    // Problem is here:
+    GenericTest<int> = new GenericTest<int>(32);
+    return 0;
+  }
+ 
+}
+ 
+
+Actual Results:
+ALPHA SOFTWARE: Mono C# Compiler 0.95.0.0 for Generics
+ 
+Unhandled Exception: System.NullReferenceException: A null value was found
+where an object instance was required.
+in <0x003aa> Mono.CSharp.Assign:DoResolve (Mono.CSharp.EmitContext)
+in <0x000cf> Mono.CSharp.Expression:Resolve
+(Mono.CSharp.EmitContext,Mono.CSharp.ResolveFlags)
+in <0x00017> Mono.CSharp.Expression:Resolve (Mono.CSharp.EmitContext)
+in <0x00020> Mono.CSharp.ExpressionStatement:ResolveStatement
+(Mono.CSharp.EmitContext)
+in <0x0001b> Mono.CSharp.StatementExpression:Resolve (Mono.CSharp.EmitContext)
+in <0x0024c> Mono.CSharp.Block:Resolve (Mono.CSharp.EmitContext)
+in <0x000d6> Mono.CSharp.EmitContext:EmitTopBlock
+(Mono.CSharp.Block,Mono.CSharp.InternalParameters,Mono.CSharp.Location)
+in <0x0054b> Mono.CSharp.MethodData:Emit
+(Mono.CSharp.TypeContainer,Mono.CSharp.Attributable)
+in <0x00016> Mono.CSharp.Method:Emit (Mono.CSharp.TypeContainer)
+in <0x00611> Mono.CSharp.TypeContainer:Emit ()
+in <0x008de> Mono.CSharp.RootContext:EmitCode ()
+in <0x00c87> Mono.CSharp.Driver:MainDriver (string[])
+in <0x0001f> Mono.CSharp.Driver:Main (string[])
+
+
+Expected Results:
+Should give an error about the missing object name.
+
+How often does this happen? 
+always