Merge pull request #2820 from kumpera/license-change-rebased
[mono.git] / mono / metadata / mono-basic-block.c
index 53c74e8cf5bf442774e648c6a6a1d09680d807af..53f21530024f24659ec67200a40fab23b4d548f6 100644 (file)
@@ -5,6 +5,7 @@
  *   Rodrigo Kumpera (rkumpera@novell.com)
  *
  * Copyright 2010 Novell, Inc (http://www.novell.com)
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 
 #include <config.h>
@@ -514,18 +515,11 @@ mono_basic_block_free (MonoSimpleBasicBlock *bb)
  * Return the list of basic blocks of method. Return NULL on failure and set @error.
 */
 MonoSimpleBasicBlock*
-mono_basic_block_split (MonoMethod *method, MonoError *error)
+mono_basic_block_split (MonoMethod *method, MonoError *error, MonoMethodHeader *header)
 {
+       MonoError inner_error;
        MonoSimpleBasicBlock *bb, *root;
        const unsigned char *start, *end;
-       MonoMethodHeader *header = mono_method_get_header (method);
-
-       mono_error_init (error);
-
-       if (!header) {
-               mono_error_set_not_verifiable (error, method, "Could not decode header");
-               return NULL;
-       }
 
        start = header->code;
        end = start + header->code_size;
@@ -551,11 +545,9 @@ 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;
 }