First set of licensing changes
[mono.git] / mono / metadata / profiler.c
index af9ac55ec7ce7a4c7ca46cb63544bb12818632d4..b2620ecf030075854d47d30ca77e767a4958c518 100644 (file)
@@ -8,6 +8,7 @@
  * Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
  * Copyright 2004-2009 Novell, Inc (http://www.novell.com)
  * Copyright 2011 Xamarin Inc (http://www.xamarin.com).
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 
 #include "config.h"
@@ -1063,6 +1064,7 @@ mono_profiler_coverage_free (MonoMethod *method)
 void 
 mono_profiler_coverage_get (MonoProfiler *prof, MonoMethod *method, MonoProfileCoverageFunc func)
 {
+       MonoError error;
        MonoProfileCoverageInfo* info = NULL;
        int i, offset;
        guint32 code_size;
@@ -1079,7 +1081,8 @@ mono_profiler_coverage_get (MonoProfiler *prof, MonoMethod *method, MonoProfileC
        if (!info)
                return;
 
-       header = mono_method_get_header (method);
+       header = mono_method_get_header_checked (method, &error);
+       mono_error_assert_ok (&error);
        start = mono_method_header_get_code (header, &code_size, NULL);
        debug_minfo = mono_debug_lookup_method (method);