[mono/mono] a769cce0: Fixes regression caused by 3912066fe1134ba665770723a24c8ea9b4f1aea3 change
| Newsgroups | gmane.comp.gnome.mono.patches |
|---|---|
| Message-ID | <000001417e6f6e78-944f0ff5-0a08-45ae-95d7-dbd2b95951c8-000000@email.amazonses.com> |
Branch: refs/heads/master
Home: https://github.com/mono/mono
Compare: https://github.com/mono/mono/compare/d7cc362ebd5f...a769cce0b77f
Commit: a769cce0b77f0fbd057b379b623f2f874f48a935
Author: Marek Safar <[email protected]> (marek-safar)
Date: 2013-10-03 13:07:45 GMT
URL: https://github.com/mono/mono/commit/a769cce0b77f0fbd057b379b623f2f874f48a935
Fixes regression caused by 3912066fe1134ba665770723a24c8ea9b4f1aea3 change
Changed paths:
M mcs/mcs/anonymous.cs
M mcs/tests/ver-il-net_4_5.xml
Added paths:
A mcs/tests/gtest-iter-31.cs
Modified: mcs/mcs/anonymous.cs
===================================================================
@@ -1698,13 +1698,12 @@ AnonymousMethodMethod DoCreateMethodHost (EmitContext ec)
// use ldftn on non-boxed instances either to share mutated state
//
parent = sm_parent.Parent.PartialContainer;
- }
- } else {
- //
- // For iterators we can host everything in one class
- //
- if (sm is IteratorStorey)
+ } else if (sm is IteratorStorey) {
+ //
+ // For iterators we can host everything in one class
+ //
parent = storey = sm;
+ }
}
}
Added: mcs/tests/gtest-iter-31.cs
===================================================================
@@ -0,0 +1,31 @@
+using System.Collections.Generic;
+using System.Linq;
+
+class B
+{
+ public object Foo (object obj)
+ {
+ return null;
+ }
+}
+
+class C
+{
+ B ctx = new B ();
+
+ public static void Main ()
+ {
+ foreach (var c in new C ().Test ()) {
+ }
+ }
+
+ IEnumerable<ushort> Test ()
+ {
+ string[] s = new[] { "a", "b", "c" };
+
+ var m = s.Select (l => ctx.Foo (l)).ToArray ();
+
+ yield break;
+ }
+}
+
Modified: mcs/tests/ver-il-net_4_5.xml
===================================================================
@@ -24461,14 +24461,14 @@
<method name="System.Collections.Generic.IEnumerator`1[System.Int32] System.Collections.Generic.IEnumerable<int>.GetEnumerator()" attrs="481">
<size>40</size>
</method>
- <method name="Void <Test>m__0()" attrs="129">
- <size>52</size>
- </method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
</method>
+ <method name="Void <>m__0()" attrs="131">
+ <size>57</size>
+ </method>
</type>
- <type name="M+<Test>c__AnonStorey1">
+ <type name="M+<Test>c__Iterator0+<Test>c__AnonStorey1">
<method name="Void <>m__1()" attrs="131">
<size>24</size>
</method>
@@ -24477,6 +24477,56 @@
</method>
</type>
</test>
+ <test name="gtest-iter-31.cs">
+ <type name="B">
+ <method name="System.Object Foo(System.Object)" attrs="134">
+ <size>10</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="C">
+ <method name="Void Main()" attrs="150">
+ <size>62</size>
+ </method>
+ <method name="System.Collections.Generic.IEnumerable`1[System.UInt16] Test()" attrs="129">
+ <size>30</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>18</size>
+ </method>
+ </type>
+ <type name="C+<Test>c__Iterator0">
+ <method name="UInt16 System.Collections.Generic.IEnumerator<ushort>.get_Current()" attrs="2529">
+ <size>14</size>
+ </method>
+ <method name="System.Object System.Collections.IEnumerator.get_Current()" attrs="2529">
+ <size>19</size>
+ </method>
+ <method name="Boolean MoveNext()" attrs="486">
+ <size>81</size>
+ </method>
+ <method name="Void Dispose()" attrs="486">
+ <size>1</size>
+ </method>
+ <method name="Void Reset()" attrs="486">
+ <size>6</size>
+ </method>
+ <method name="IEnumerator System.Collections.IEnumerable.GetEnumerator()" attrs="481">
+ <size>14</size>
+ </method>
+ <method name="System.Collections.Generic.IEnumerator`1[System.UInt16] System.Collections.Generic.IEnumerable<ushort>.GetEnumerator()" attrs="481">
+ <size>40</size>
+ </method>
+ <method name="System.Object <>m__0(System.String)" attrs="131">
+ <size>25</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="gtest-lambda-01.cs">
<type name="IntFunc">
<method name="Int32 Invoke(Int32)" attrs="454">
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches