Make nested type loading lazier.
[mono.git] / mono / metadata / mono-basic-block.c
index 1e683279f519bc8fdadc52899ad40d1af061742e..51e6d7096ad01062c75776bf9142f0ee8313a645 100644 (file)
@@ -550,9 +550,11 @@ 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;
 }
@@ -614,7 +616,7 @@ mono_opcode_value_and_size (const unsigned char **ip, const unsigned char *end,
                g_error ("Invalid opcode %d argument %d max opcode %d\n", i, mono_opcodes [i].argument, MONO_CEE_LAST);
        }
 
-       if (ADD_IS_GREATER_OR_OVF (p, size, end))
+       if (ADDP_IS_GREATER_OR_OVF (p, size, end))
                return -1;
 
        return (p - start) + size;