X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fprofiler.c;h=f5891ccd38f5a6b0b296ba45a538d74fe785f1ad;hb=aa3de31b70d1c5826d67147696423cdd9c334d41;hp=103e966d948325cdac02c9dddd278cdb3824e6ef;hpb=20113c5ec74ed5b747321f7fecc5e60ef4f02abe;p=mono.git diff --git a/mono/metadata/profiler.c b/mono/metadata/profiler.c index 103e966d948..f5891ccd38f 100644 --- a/mono/metadata/profiler.c +++ b/mono/metadata/profiler.c @@ -1013,7 +1013,7 @@ mono_profiler_coverage_free (MonoMethod *method) void mono_profiler_coverage_get (MonoProfiler *prof, MonoMethod *method, MonoProfileCoverageFunc func) { - MonoProfileCoverageInfo* info; + MonoProfileCoverageInfo* info = NULL; int i, offset; guint32 code_size; const unsigned char *start, *end, *cil_code; @@ -1022,7 +1022,8 @@ mono_profiler_coverage_get (MonoProfiler *prof, MonoMethod *method, MonoProfileC MonoDebugMethodInfo *debug_minfo; mono_profiler_coverage_lock (); - info = g_hash_table_lookup (coverage_hash, method); + if (coverage_hash) + info = g_hash_table_lookup (coverage_hash, method); mono_profiler_coverage_unlock (); if (!info) @@ -1196,17 +1197,15 @@ mono_profiler_load (const char *desc) } if (!load_embedded_profiler (desc, mname)) { libname = g_strdup_printf ("mono-profiler-%s", mname); - if (!load_profiler_from_directory (NULL, libname, desc)) { - res = FALSE; #if defined (MONO_ASSEMBLIES) - res = load_profiler_from_directory (mono_assembly_getrootdir (), libname, desc); + res = load_profiler_from_directory (mono_assembly_getrootdir (), libname, desc); #endif - if (!res) - res = load_profiler_from_mono_instalation (libname, desc); - - if (!res) - g_warning ("The '%s' profiler wasn't found in the main executable nor could it be loaded from '%s'.", mname, libname); - } + if (!res) + res = load_profiler_from_directory (NULL, libname, desc); + if (!res) + res = load_profiler_from_mono_instalation (libname, desc); + if (!res) + g_warning ("The '%s' profiler wasn't found in the main executable nor could it be loaded from '%s'.", mname, libname); g_free (libname); } g_free (mname);