2007-06-25 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Mon, 25 Jun 2007 21:34:50 +0000 (21:34 -0000)
committerZoltan Varga <vargaz@gmail.com>
Mon, 25 Jun 2007 21:34:50 +0000 (21:34 -0000)
* ssa.c (visit_inst): Add support for OP_BR. Fixes #81946.

* generic.2.cs: Add new test case.

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

mono/mini/ChangeLog
mono/mini/generics.2.cs
mono/mini/ssa.c

index ba2da08b559283ce4e88eb458176927ea03ddfff..d7a5eea60f90b6db8c506412dab1fcadbbaedc03 100644 (file)
@@ -1,3 +1,9 @@
+2007-06-25  Zoltan Varga  <vargaz@gmail.com>
+
+       * ssa.c (visit_inst): Add support for OP_BR. Fixes #81946.
+
+       * generic.2.cs: Add new test case.
+
 2007-06-25  Martin Baulig  <martin@ximian.com>
 
        Merged the `debugger-dublin' branch.
index f923a6e56c05e93bf55d7381825d35da7f23a104..46df57531d3115802073241a1d208d0d0844f96b 100644 (file)
@@ -156,6 +156,14 @@ class Tests {
                        return 0;
     }
 
+       public static int test_0_box_brtrue_opt () {
+               Foo<int> f = new Foo<int> (5);
+
+               f [123] = 5;
+
+               return 0;
+       }
+
        public static int test_0_box_brtrue_opt_regress_81102 () {
                if (new Foo<int>(5).ToString () == "null")
                        return 0;
@@ -178,6 +186,13 @@ class Tests {
                public String Bar (String s) {
                        return s;
                }
+
+               public int this [T1 key] {
+                       set {
+                               if (key == null)
+                                       throw new ArgumentNullException ("key");
+                       }
+               }
                
                readonly T1 m_t1;
        }
index c7cc57065e8f5a5cd3580fe684db7217725bee08..46cbc934ff6308f7c095d704ffd8621e42732bb6 100644 (file)
@@ -992,6 +992,13 @@ visit_inst (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *inst, GList **cvars,
                                }
                        }
                }
+       } else if (inst->opcode == OP_BR) {
+               MonoBasicBlock *target = inst->inst_target_bb;
+
+               if (!(target->flags &  BB_REACHABLE)) {
+                       target->flags |= BB_REACHABLE;
+                       *bblist = g_list_prepend (*bblist, target);
+               }
        } else if ((inst->opcode >= CEE_BEQ && inst->opcode <= CEE_BLT_UN) &&
            ((inst->inst_i0->opcode == OP_COMPARE) || (inst->inst_i0->opcode == OP_LCOMPARE))) {
                int a, b, r1, r2;