[Mono-dev] Compiler bug in foreach

Alan McGovern alan.mcgovern at gmail.com
Sun May 30 13:42:53 EDT 2010


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.


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

More information about the Mono-devel-list mailing list