[runtime] Call error_init instead of mono_error_init (#4425)
[mono.git] / mono / metadata / mono-basic-block.c
index 53f21530024f24659ec67200a40fab23b4d548f6..1241ea2c134757c2306748754912bd7691cadd50 100644 (file)
@@ -240,6 +240,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)) {
@@ -336,6 +338,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) {
@@ -464,6 +468,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;
@@ -517,10 +524,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;