Author: martin
Date: 2005-05-23 13:15:14 -0400 (Mon, 23 May 2005)
New Revision: 44912

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/statement.cs
Log:
2005-05-23  Martin Baulig  <[EMAIL PROTECTED]>

        * statement.cs (Try.DoResolve): Don't create a `finally' if we
        don't need to.  Fix #75014.



Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2005-05-23 16:02:38 UTC (rev 44911)
+++ trunk/mcs/gmcs/ChangeLog    2005-05-23 17:15:14 UTC (rev 44912)
@@ -1,3 +1,8 @@
+2005-05-23  Martin Baulig  <[EMAIL PROTECTED]>
+
+       * statement.cs (Try.DoResolve): Don't create a `finally' if we
+       don't need to.  Fix #75014.
+
 2005-05-20  Miguel de Icaza  <[EMAIL PROTECTED]>
 
        * typemanager.cs: Do not throw an exception in the TypeBuilder

Modified: trunk/mcs/gmcs/statement.cs
===================================================================
--- trunk/mcs/gmcs/statement.cs 2005-05-23 16:02:38 UTC (rev 44911)
+++ trunk/mcs/gmcs/statement.cs 2005-05-23 17:15:14 UTC (rev 44912)
@@ -3114,7 +3114,7 @@
                {
                        if (emit_finally)
                                ec.ig.BeginFinallyBlock ();
-                       else
+                       else if (ec.InIterator)
                                ec.CurrentIterator.MarkFinally (ec, 
parent_vectors);
                        EmitFinally (ec);
                }
@@ -3751,10 +3751,16 @@
                                if (!Fini.Resolve (ec))
                                        ok = false;
                                ec.InFinally = was_finally;
+
+                               if (!ec.InIterator)
+                                       need_exc_block = true;
                        }
 
-                       ResolveFinally (branching);
-                       need_exc_block |= emit_finally;
+                       if (ec.InIterator) {
+                               ResolveFinally (branching);
+                               need_exc_block |= emit_finally;
+                       } else
+                               emit_finally = Fini != null;
 
                        FlowBranching.Reachability reachability = 
ec.EndFlowBranching ();
 
@@ -3812,9 +3818,8 @@
 
                public override void EmitFinally (EmitContext ec)
                {
-                       if (Fini != null){
+                       if (Fini != null)
                                Fini.Emit (ec);
-                       }
                }
 
                public bool HasCatch

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to