[Mono-dev] mcs bug

Jeroen Frijters jeroen at sumatra.nl
Sun Aug 6 06:55:16 EDT 2006


Hi Marek,

I spent quite a bit of time crafting a small repro, which I don't mind
doing, but I'm not about to waste my time wrestling with bugzilla.

Regards,
Jeroen

> -----Original Message-----
> From: Marek Safar [mailto:marek.safar at seznam.cz] 
> Sent: Sunday, August 06, 2006 12:10
> To: Jeroen Frijters
> Cc: mono-devel-list at lists.ximian.com
> Subject: Re: [Mono-dev] mcs bug
> 
> Hello Jeroen,
> 
> Yes, it is mcs/gmcs bug. Please, fill a bug report on 
> bugzilla.ximian.com
> 
> Thanks,
> Marek
> > I ran into a bug in mcs. The program below obviously should 
> print 42,
> > but it prints 0, because mcs reuses loc.0 for two different things
> > within the same expression.
> >
> > Regards,
> > Jeroen
> >
> > using System;
> >
> > class Repro
> > {
> > 	private int[] stack = new int[1];
> > 	private int cc;
> > 	public int fc;
> > 	private int sp;
> >
> > 	public static void Main()
> > 	{
> > 		Repro r = new Repro();
> > 		r.foo();
> > 		Console.WriteLine(r.stack[0]);
> > 	}
> >
> > 	public void foo()
> > 	{
> > 		fc = cc = bar();
> > 		fc = stack[sp++] = cc;
> > 	}
> >
> > 	private int bar()
> > 	{
> > 		return 42;
> > 	}
> > }
> > _______________________________________________
> > Mono-devel-list mailing list
> > Mono-devel-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-devel-list
> >
> >   
> 
> 



More information about the Mono-devel-list mailing list