Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / metadata / mono-basic-block.c
index 5f9aa0736f401205a52d5500a3eb9fdee31d8010..9d28614b16e822487c9f258b88c4875bf3ce9a75 100644 (file)
@@ -1,10 +1,12 @@
-/*
- * 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>
@@ -239,6 +241,8 @@ bb_split (MonoSimpleBasicBlock *first, MonoSimpleBasicBlock *hint, MonoSimpleBas
 {
        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)) {
@@ -335,6 +339,8 @@ bb_formation_il_pass (const unsigned char *start, const unsigned char *end, Mono
        MonoSimpleBasicBlock *branch, *next, *current;
        const MonoOpcode *opcode;
 
+       error_init (error);
+
        current = bb;
 
        while (ip < end) {
@@ -463,6 +469,9 @@ bb_formation_eh_pass (MonoMethodHeader *header, MonoSimpleBasicBlock *bb, MonoSi
 {
        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;
@@ -516,10 +525,11 @@ mono_basic_block_free (MonoSimpleBasicBlock *bb)
 MonoSimpleBasicBlock*
 mono_basic_block_split (MonoMethod *method, MonoError *error, MonoMethodHeader *header)
 {
-       MonoError inner_error;
        MonoSimpleBasicBlock *bb, *root;
        const unsigned char *start, *end;
 
+       error_init (error);
+
        start = header->code;
        end = start + header->code_size;