[Mono-bugs] [Bug 423981] Double.NaN handling is broken

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Sep 5 20:44:55 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=423981

User rkumpera at novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=423981#c2


Rodrigo Kumpera <rkumpera at novell.com> changed:

           What    |Removed                                         |Added
----------------------------------------------------------------------------
                 CC|                                                |rkumpera at novell.com
          Component|misc                                            |C#
            Product|Mono: Runtime                                   |Mono: Compilers
   Target Milestone|---                                             |SVN




--- Comment #2 from Rodrigo Kumpera <rkumpera at novell.com>  2008-09-05 18:44:54 MDT ---
This is a bug on MCS.

The attached code compiled with csc run just fine under mono and MS
The attached code compiled with mcs fails under mono and MS

The bug is in the code generated for lazy evaluating the expression.

For instance "if (width < 0)" works fine, but "if (width < 0 || width < 0)"
fails.

The issue is that MCS is not property inverting the condition opcode of the
first branch.

The code for "if (width <0) .." is:

push 0
push width
compare and branch if greater or unordered to 'else' clause
then clause:
..
goto end
else clause:
..
end:
..


But if the is "if (width < 0 || ...)", the branch op must be inverted:

push 0
push width
//invert the condition and go to the then clause
compare and branch if less to 'then' clause
..check other clauses

else clause:
..
goto end
then clause:
...
end:
..


What happens is that the first condition is bge.un (branch greater than or
unordered) and it's opposite is blt (branch less than) without unordered check. 


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