[nem-bug] [Nemerle 0001040]: Invalid IL generated by block return

feedback at nemerle.org feedback at nemerle.org
Sat Aug 18 03:41:27 CEST 2007


The following issue has been SUBMITTED.
======================================================================
<http://nemerle.org/bugs/view.php?id=1040> 
======================================================================
Reported By:                Evin Robertson
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   1040
Category:                   Compiler
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             08-18-2007 03:41 CEST
Last Modified:              08-18-2007 03:41 CEST
======================================================================
Summary:                    Invalid IL generated by block return
Description: 
The following program generates invalid IL.  I think the problem is the
unneeded initial ldarg.1

public class InvalidBlockReturn
{
    private static F(x : int, z : ref int) : int
    {
        result:
        {
            z = match(x)
            {
                | 0 =>
                    result(5)
                | _ =>
                    x
            }
            F(x-1, ref z)
        }
    }

    public static Main(_ : array[string]) : void
    {
        mutable z;
        System.Console.WriteLine(F(2, ref z).ToString())
    }
}


I can work around it by declaring a temporary variable to hold the result
of the match and then assigning it to z.

======================================================================

Issue History
Date Modified  Username       Field                    Change              
======================================================================
08-18-07 03:41 Evin Robertson New Issue                                    
======================================================================




More information about the bugs mailing list