-/*
- * mono-basic-block.c: Routines for parsing basic blocks from the IL stream
+/**
+ * \file
+ * Routines for parsing basic blocks from the IL stream
*
* Authors:
* 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>
{
MonoSimpleBasicBlock *res, *bb = first;
+ error_init (error);
+
if (bb_idx_is_contained (hint, target)) {
first = hint;
} else if (hint->next && bb_idx_is_contained (hint->next, target)) {
MonoSimpleBasicBlock *branch, *next, *current;
const MonoOpcode *opcode;
+ error_init (error);
+
current = bb;
while (ip < end) {
{
int i;
int end = header->code_size;
+
+ error_init (error);
+
/*We must split at all points to verify for targets in the middle of an instruction*/
for (i = 0; i < header->num_clauses; ++i) {
MonoExceptionClause *clause = header->clauses + i;
* 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_checked (method, &inner_error);
-
- mono_error_init (error);
- if (!header) {
- mono_error_set_not_verifiable (error, method, "Could not decode header due to %s", mono_error_get_message (&inner_error));
- mono_error_cleanup (&inner_error);
- return NULL;
- }
+ error_init (error);
start = header->code;
end = start + header->code_size;
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;
}