2008-10-16 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Thu, 16 Oct 2008 14:32:28 +0000 (14:32 -0000)
committerMartin Baulig <martin@novell.com>
Thu, 16 Oct 2008 14:32:28 +0000 (14:32 -0000)
* anonymous.cs (AnonymousMethodStorey): Put back the
`hoisted_locals' hashtable and use it in EmitType().

svn path=/trunk/mcs/; revision=116003

mcs/mcs/ChangeLog
mcs/mcs/anonymous.cs

index a3c62697d1cfb7bd3e72934b526db50b80d15c5b..8e93638cb160ae21cfd869435c28ea9158903c92 100644 (file)
@@ -1,3 +1,8 @@
+2008-10-16  Martin Baulig  <martin@ximian.com>
+
+       * anonymous.cs (AnonymousMethodStorey): Put back the
+       `hoisted_locals' hashtable and use it in EmitType().
+
 2008-10-15  Marek Safar  <marek.safar@gmail.com>
 
        * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
index e73dcf0a92cce1a7a0fce2919688420262a2b136..0f23979e64b3e69c418e99dc83048b174ea01b6b 100644 (file)
@@ -106,6 +106,7 @@ namespace Mono.CSharp {
 
                // A list of hoisted parameters
                protected ArrayList hoisted_params;
+               protected ArrayList hoisted_locals;
 
                // Hoisted this
                protected HoistedThis hoisted_this;
@@ -181,6 +182,11 @@ namespace Mono.CSharp {
                        HoistedVariable var = new HoistedLocalVariable (this, local_info, GetVariableMangledName (local_info));
                        local_info.HoistedVariableReference = var;
                        has_hoisted_variable = true;
+
+                       if (hoisted_locals == null)
+                               hoisted_locals = new ArrayList ();
+
+                       hoisted_locals.Add (var);
                }
 
                public void CaptureParameter (EmitContext ec, ParameterReference param_ref)
@@ -341,10 +347,9 @@ namespace Mono.CSharp {
                        if (hoisted_this != null)
                                hoisted_this.EmitSymbolInfo ();
 
-                       foreach (LocalInfo li in OriginalSourceBlock.Variables.Values) {
-                               HoistedVariable hv = li.HoistedVariableReference;
-                               if (hv != null)
-                                       hv.EmitSymbolInfo ();
+                       if (hoisted_locals != null) {
+                               foreach (HoistedVariable local in hoisted_locals)
+                                       local.EmitSymbolInfo ();
                        }
 
                        if (hoisted_params != null) {