[Mono-bugs] [Bug 559876] New: Exception raise resets values

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Dec 2 09:01:51 EST 2009



           Summary: Exception raise resets values
    Classification: Mono
           Product: Mono: Runtime
           Version: SVN
          Platform: x86
        OS/Version: SuSE Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: JIT
        AssignedTo: lupus at novell.com
        ReportedBy: lambourg at adacore.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

Created an attachment (id=330499)
 --> (http://bugzilla.novell.com/attachment.cgi?id=330499)
test.cs, shows the issue

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us)
AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10

Certainly due to an incorrect optimisation, but the attached small test shows
the issue:

   public static void Main ()
      int myb = 4; // First assign

      try {
        myb = int_func (8); //  returns 8, so at this point myb ==8
        do_raise(); //  raises an exception
        myb = int_func (2); //  should never be called. If not here, the bug
does not reproduce
      } catch (System.Exception) {
        System.Console.WriteLine (myb); //  prints 4 !!! should have printed 8
        System.Console.WriteLine ("above should be 8");

Attached is the full example

Reproducible: Always

Steps to Reproduce:
1. gmcs test.cs (you can also compile from the microsoft's C# compiler)
2. mono ./test.exe
3. The printed value is incorrect

$ mono --version
Mono JIT compiler version 20091121

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list