Create GC maps for methods with nono-finally clauses.
authorZoltan Varga <vargaz@gmail.com>
Wed, 22 Sep 2010 22:18:53 +0000 (00:18 +0200)
committerZoltan Varga <vargaz@gmail.com>
Mon, 3 Jan 2011 14:42:33 +0000 (15:42 +0100)
mono/mini/mini-gc.c

index 89c9f4c7060d5d926f89b193a4a09570336b054d..24df74d9de37d9b3bc4efa8c4375481928f0ca53 100644 (file)
@@ -2057,6 +2057,8 @@ create_map (MonoCompile *cfg)
 void
 mini_gc_create_gc_map (MonoCompile *cfg)
 {
+       int i;
+
        if (!cfg->compute_gc_maps)
                return;
 
@@ -2070,12 +2072,16 @@ mini_gc_create_gc_map (MonoCompile *cfg)
                /* Without liveness info, the live ranges are not precise enough */
                return;
 
-       if (cfg->header->num_clauses)
-               /*
-                * The calls to the finally clauses don't show up in the cfg. See
-                * test_0_liveness_8 ().
-                */
-               return;
+       for (i = 0; i < cfg->header->num_clauses; ++i) {
+               MonoExceptionClause *clause = &cfg->header->clauses [i];
+
+               if (clause->flags == MONO_EXCEPTION_CLAUSE_FINALLY)
+                       /*
+                        * The calls to the finally clauses don't show up in the cfg. See
+                        * test_0_liveness_8 ().
+                        */
+                       return;
+       }
 
        mono_analyze_liveness_gc (cfg);