Mon Mar 8 17:30:44 CET 2010 Paolo Molaro <lupus@ximian.com>
authorPaolo Molaro <lupus@oddwiz.org>
Mon, 8 Mar 2010 16:34:01 +0000 (16:34 -0000)
committerPaolo Molaro <lupus@oddwiz.org>
Mon, 8 Mar 2010 16:34:01 +0000 (16:34 -0000)
* verify.c, debug-helpers.c, profiler.c, loader.c,
mono-basic-block.c, mono-debug.c, reflection.c: prepare to make
MonoMethodHeader a transient entity.

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

mono/metadata/ChangeLog
mono/metadata/debug-helpers.c
mono/metadata/loader.c
mono/metadata/mono-basic-block.c
mono/metadata/mono-debug.c
mono/metadata/profiler.c
mono/metadata/reflection.c
mono/metadata/verify.c

index 8f11863ddd735f32a22dad7b122e163f99b225c4..a54ecfb39dc55261ed51e7390179be3a2cf50419 100644 (file)
@@ -1,3 +1,10 @@
+
+Mon Mar 8 17:30:44 CET 2010 Paolo Molaro <lupus@ximian.com>
+
+       * verify.c, debug-helpers.c, profiler.c, loader.c,
+       mono-basic-block.c, mono-debug.c, reflection.c: prepare to make
+       MonoMethodHeader a transient entity.
+
 2010-03-08  Zoltan Varga  <vargaz@gmail.com>
 
        * sgen-gc.c (scan_needed_big_objects): Call drain_gray_stack () to avoid
index cceaaef13e37969f3e2dd4689222e230fc3b3e45..e3cfd09b61ed439605aadb0db8bd7383c2d1d2f9 100644 (file)
@@ -683,6 +683,7 @@ dis_one (GString *str, MonoDisHelper *dh, MonoMethod *method, const unsigned cha
        if (dh->newline)
                g_string_append (str, dh->newline);
 
+       mono_metadata_free_mh (header);
        return ip;
 }
 
index 22b9faa6bf96e2d2e79fc8b18936174cccf54437..e08e19c81e2e2560fb33b73a11bcfd72a24d3525 100644 (file)
@@ -2296,7 +2296,8 @@ mono_method_get_header (MonoMethod *method)
                return NULL;
 
        loc = mono_image_rva_map (img, rva);
-       g_assert (loc);
+       if (!loc)
+               return NULL;
 
        header = mono_metadata_parse_mh_full (img, mono_method_get_generic_container (method), loc);
 
index 651333cfaad292558183a4dd9277a8ba8a6909a7..51e6d7096ad01062c75776bf9142f0ee8313a645 100644 (file)
@@ -550,9 +550,11 @@ mono_basic_block_split (MonoMethod *method, MonoError *error)
        dump_bb_list (bb, &root, g_strdup_printf("AFTER LIVENESS %s", mono_method_full_name (method, TRUE)));
 #endif
 
+       mono_metadata_free_mh (header);
        return bb;
 
 fail:
+       mono_metadata_free_mh (header);
        mono_basic_block_free (bb);
        return NULL;
 }
index c9591dce763f05f884a2c5ac8ec6c591d9b40344..0b8f8063358dea16c0fa4361f6919b9204019deb 100644 (file)
@@ -668,6 +668,7 @@ mono_debug_add_method (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDoma
                        wrapper->method_name = mono_method_full_name (declaring, TRUE);
                        wrapper->cil_code = mono_disasm_code (
                                NULL, declaring, il_code, il_code + il_codesize);
+                       mono_metadata_free_mh (mheader);
                }
        } else {
                address->header.wrapper_data = header->wrapper_data;
index 7d90dca83b051f4e9a413645cf5f842d60afa9da..7e050c1ed3700622ba4b219a3df8cd3b47f32a1c 100644 (file)
@@ -955,6 +955,7 @@ mono_profiler_coverage_get (MonoProfiler *prof, MonoMethod *method, MonoProfileC
                        g_free (fname);
                }
        }
+       mono_metadata_free_mh (header);
 }
 
 #ifndef DISABLE_PROFILER
index 281d34f8ddad4b89fd06c9abab19088f04e4d2a8..f5f035470cb3de6821666bda6cdecd606c31842d 100644 (file)
@@ -6926,6 +6926,7 @@ mono_method_body_get_object (MonoDomain *domain, MonoMethod *method)
        }
 
        CACHE_OBJECT (MonoReflectionMethodBody *, method, ret, NULL);
+       mono_metadata_free_mh (header);
        return ret;
 }
 
index 059edd5375da9530dbcc04c68c783e00a37438b2..03e4677ab0c24dd485a10313cf28d45973d5bf37 100644 (file)
@@ -6046,6 +6046,7 @@ cleanup:
        g_free (ctx.locals);
        g_free (ctx.params);
        mono_basic_block_free (bb);
+       mono_metadata_free_mh (ctx.header);
 
        return ctx.list;
 }