if (td->max_stack_height > header->max_stack * 3 && header->max_stack > 16)
g_warning ("Excessive stack space usage for method %s, %d/%d", method->name, td->max_stack_height, header->max_stack);
- int code_len;
- code_len = td->new_code_end - td->new_code;
+ int code_len_u8, code_len_u16;
+ code_len_u8 = (guint8 *) td->new_code_end - (guint8 *) td->new_code;
+ code_len_u16 = td->new_code_end - td->new_code;
rtm->clauses = (MonoExceptionClause*)mono_domain_alloc0 (domain, header->num_clauses * sizeof (MonoExceptionClause));
memcpy (rtm->clauses, header->clauses, header->num_clauses * sizeof(MonoExceptionClause));
int end_off = c->try_offset + c->try_len;
c->try_offset = get_in_offset (td, c->try_offset);
c->try_len = find_in_offset (td, end_off) - c->try_offset;
- g_assert ((c->try_offset + c->try_len) < code_len);
+ g_assert ((c->try_offset + c->try_len) < code_len_u16);
end_off = c->handler_offset + c->handler_len;
c->handler_offset = get_in_offset (td, c->handler_offset);
c->handler_len = find_in_offset (td, end_off) - c->handler_offset;
- g_assert (c->handler_len >= 0 && (c->handler_offset + c->handler_len) <= code_len);
+ g_assert (c->handler_len >= 0 && (c->handler_offset + c->handler_len) <= code_len_u16);
if (c->flags & MONO_EXCEPTION_CLAUSE_FILTER)
c->data.filter_offset = get_in_offset (td, c->data.filter_offset);
}
jinfo = (MonoJitInfo *)mono_domain_alloc0 (domain, jinfo_len);
jinfo->is_interp = 1;
rtm->jinfo = jinfo;
- mono_jit_info_init (jinfo, method, (guint8*)rtm->code, code_len, (MonoJitInfoFlags)0, header->num_clauses, 0);
+ mono_jit_info_init (jinfo, method, (guint8*)rtm->code, code_len_u8, (MonoJitInfoFlags)0, header->num_clauses, 0);
for (i = 0; i < jinfo->num_clauses; ++i) {
MonoJitExceptionInfo *ei = &jinfo->clauses [i];
MonoExceptionClause *c = rtm->clauses + i;