[Mono-bugs] [Bug 628036] New: Missing closing paren in some statements causes an internal compiler error

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Aug 3 13:56:18 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=628036

http://bugzilla.novell.com/show_bug.cgi?id=628036#c0


           Summary: Missing closing paren in some statements causes an
                    internal compiler error
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.4.x
          Platform: PC
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: BigBoss1964 at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Community User
           Blocker: ---


Created an attachment (id=380303)
 --> (http://bugzilla.novell.com/attachment.cgi?id=380303)
Code to reproduce the bug

Description of Problem:

Code like statement (new ClassName() { typename varname = value; code } causes
an internal compiler error. I've attached a file demonstrating.

Steps to reproduce the problem:
    1. Create a class with a method in it.
    2. In that method place a statement with a body containing new ClassName()
but leave off the statements closing ) before the {. (See attachment for two
examples)
    3. Compile with mcs or gmcs.


Actual Results:

    built with$ mcs crash.cs
    crash.cs(10,21): error CS1526: A new expression requires () or [] after
type
    crash.cs(10,26): error CS8032: Internal compiler error during parsing, Run
with -v for details
    Compilation failed: 2 error(s), 0 warnings

    built with$ mcs -v crash.cs
    crash.cs(10,21): error CS1526: A new expression requires () or [] after
type System.NullReferenceException: Object reference not set to an instance of
an object
      at Mono.CSharp.SimpleAssign..ctor (Mono.CSharp.Expression target,
Mono.CSharp.Expression source) [0x00000] 
      at Mono.CSharp.CSharpParser.yyparse (yyInput yyLex) [0x00000] 
      at Mono.CSharp.CSharpParser.parse () [0x00000] 
    crash.cs(10,26): error CS8032: Internal compiler error during parsing, Run
with -v for details
    Compilation failed: 2 error(s), 0 warnings


Expected Results:

    Something along the lines of: 
        filename(col, row): Unexpected symbol `{'
        filename(col, row): error CS8025: Parsing error

    or output compatible with Microsoft's compiler. When built 'mcs crash.cs'

How often does this happen? 

    Always

Additional Information:


I was curious whether using (new DisposableClass()) {} would be reported as an
error or a warning, and fed it to the compiler. I had made the typo of leaving
off the last ')', and bingo... internal compiler error.

Usually I only get those when making template related typo's in Visual C++ :-P.

-- 
Configure bugmail: http://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