[Mono-list] A serious bug in C#???

yoros@wanadoo.es yoros@wanadoo.es
Fri, 25 Apr 2003 18:20:11 +0200


On Fri, Apr 25, 2003 at 06:10:48PM +0400, Nikolai Smirnov wrote:
> Dear colleagues!
> 
> I'll try this code:
> 
> class My
> {
>     public static void Main()
>     {
>          int i = 0;
>          System.Console.WriteLine(i++ + i++ + i++);
>                                   // 0 + 1 + 2
>     }
> }
> 
> mcs My.cs
> momo My.exe
> 
> and I recieved "4" instead of "3" in C# for M$.NET or Java.
> 
> I've checked also:
> 
> int i = 0;
> i = i++ + i++ + i++;
> 
> in gcc 3.2.2-5 RH9: "3".

It is solved in the new JIT.

Regards,

    Pedro

-- 
Pedro Martínez Juliá
\  yoros@terra.es
)|    yoros@wanadoo.es
/        http://yoros.cjb.net
Socio HispaLinux #311
Usuario Linux #275438 - http://counter.li.org
GnuPG public information:  pub  1024D/74F1D3AC
Key fingerprint = 8431 7B47 D2B4 5A46 5F8E  534F 588B E285 74F1 D3AC