[Mono-dev] Compiler bug in foreach

Mehrdad Reshadi reshadi at gmail.com
Sun May 30 22:49:23 EDT 2010


Thanks Alan,
I saw this in an application. For now, I added an empty virtual function in
the middle class that calls the base.* function. This works for now until a
fix is applied.

thanks,
--mehrdad.

On Sun, May 30, 2010 at 10:42 AM, Alan McGovern <alan.mcgovern at gmail.com>wrote:

> Hey,
>
> I filed a bug and then realised you had already filed it. I marked
> mine as a duplicate of yours and changed the severity of yours to a
> more appropriate level. Generally speaking we reserve 'critical' for
> bugs which affect a large proportion of applications (> 50%) and cause
> major issues or security holes in those applications.
>
> Thanks for filing the bug and hopefully it'll get sorted soon. If you
> need a workaround *right now* then the easiest thing to do would be to
> compile using the microsoft compiler and then run the resulting
> assembly under mono. This is purely a compile time bug.
>
> Alan.
>
> On Sun, May 30, 2010 at 4:53 PM, Alan McGovern <alan.mcgovern at gmail.com>
> wrote:
> > There was a regression in trunk about 2 weeks ago which was fixed
> > about 4 days ago which was very similar to this. However your testcase
> > appears to fail on both mono 2.6.4 and svn trunk. Would you be able to
> > file a bug report with this testcase?
> >
> > Thanks!
> > Alan.
> >
> > On Sat, May 29, 2010 at 2:11 AM, Robert Jordan <robertj at gmx.net> wrote:
> >> On 29.05.2010 01:44, Mehrdad Reshadi wrote:
> >>> I found the following bug, wondering if others have seen this, or
> anything
> >>> is being done to solve it. "foreach" is too common to have such a bug!
> >>
> >>>          public static void Main(string[] args)
> >>>          {
> >>>              var o = new Y();
> >>>              foreach (var c in new A[3] { new A(), new B(), new C() })
> >>>                  c.f(o);
> >>>              new B().f(o);
> >>>          }
> >>
> >> "foreach" is obviously not the culprit, because the issue can
> >> be reproduced with an unrolled loop:
> >>
> >>         public static void Main(string[] args)
> >>         {
> >>             var o = new Y();
> >>             var a = new A[3] { new A(), new B(), new C() };
> >>            a[0].f(o);
> >>            a[1].f(o);
> >>            a[2].f(o);
> >>             new B().f(o);
> >>         }
> >>
> >> Please visit http://mono-project.com/Bugs and file a bug.
> >>
> >> Robert
> >>
> >> _______________________________________________
> >> Mono-devel-list mailing list
> >> Mono-devel-list at lists.ximian.com
> >> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> >>
> >
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100530/7dd6c8db/attachment.html 


More information about the Mono-devel-list mailing list