2006-06-13 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Tue, 13 Jun 2006 15:52:59 +0000 (15:52 -0000)
committerZoltan Varga <vargaz@gmail.com>
Tue, 13 Jun 2006 15:52:59 +0000 (15:52 -0000)
* branch-opts.c (mono_branch_optimize_exception_target): Avoid branches
which branch to outer exception clauses since they could skip the
inner finally clauses. Fixes #78633.

* exceptions.cs: Add a test for the above.

svn path=/trunk/mono/; revision=61667

mono/mini/ChangeLog
mono/mini/exceptions.cs

index d81b077708ac3a9bf51b222763d7bab48d159252..7fcc4341d4707194e04843fc2752997967683a48 100644 (file)
@@ -1,5 +1,11 @@
 2006-06-13  Zoltan Varga  <vargaz@gmail.com>
 
+       * branch-opts.c (mono_branch_optimize_exception_target): Avoid branches
+       which branch to outer exception clauses since they could skip the
+       inner finally clauses. Fixes #78633.
+
+       * exceptions.cs: Add a test for the above.
+
        * mini.c (merge_basic_blocks): Nullify the branch at the end of the first bb.
        Fixes #78629.
 
index 815a20a2f2bca25bd7f71fbb3e3beb37a51944e1..5e4521ebc183f7a41159a7ec6efc328764e83d3e 100644 (file)
@@ -2254,5 +2254,23 @@ class Tests {
                }
                return 1;
        }
+
+       // bug #78633
+       public static int test_0_throw_to_branch_opt_outer_clause () {
+               int i = 0;
+
+               try {
+                       try {
+                               string [] files = new string[1];
+
+                               string s = files[2];
+                       } finally {
+                               i ++;
+                       }
+               } catch {
+               }
+
+               return (i == 1) ? 0 : 1;
+       }               
 }