MONO_ARCH_SAVE_REGS;
- EnterCriticalSection (metadata_section);
addr = mono_compile_method (method);
- LeaveCriticalSection (metadata_section);
return addr;
}
static gint64
mono_llmult (gint64 a, gint64 b)
{
- MONO_ARCH_SAVE_REGS;
+ /* no need, no exceptions: MONO_ARCH_SAVE_REGS;*/
return a * b;
}
res += t1;
+ if (res < 0)
+ goto raise_exception;
+
if (sign < 0)
return -res;
else
{
guint64 res;
- MONO_ARCH_SAVE_REGS;
+ /* no need, no exceptions: MONO_ARCH_SAVE_REGS;*/
res = a << shamt;
/*printf ("TESTL %lld << %d = %lld\n", a, shamt, res);*/
{
guint64 res;
- MONO_ARCH_SAVE_REGS;
+ /* no need, no exceptions: MONO_ARCH_SAVE_REGS;*/
res = a >> shamt;
/*printf ("TESTR %lld >> %d = %lld\n", a, shamt, res);*/
{
gint64 res;
- MONO_ARCH_SAVE_REGS;
+ /* no need, no exceptions: MONO_ARCH_SAVE_REGS;*/
res = a >> shamt;
/*printf ("TESTR %lld >> %d = %lld\n", a, shamt, res);*/
{
MonoClass *class;
va_list ap;
- int i, ind, esize;
+ int i, ind, esize, realidx;
gpointer ea;
MONO_ARCH_SAVE_REGS;
class = this->obj.vtable->klass;
- ind = va_arg(ap, int);
g_assert (this->bounds != NULL);
- ind -= this->bounds [0].lower_bound;
+ esize = mono_array_element_size (class);
+ ind = va_arg(ap, int);
+ ind -= (int)this->bounds [0].lower_bound;
+ if ((guint32)ind >= (guint32)this->bounds [0].length)
+ mono_raise_exception (mono_get_exception_index_out_of_range ());
for (i = 1; i < class->rank; i++) {
- ind = ind*this->bounds [i].length + va_arg(ap, int) -
- this->bounds [i].lower_bound;;
+ realidx = va_arg(ap, int) - (int)this->bounds [i].lower_bound;
+ if ((guint32)realidx >= (guint32)this->bounds [i].length)
+ mono_raise_exception (mono_get_exception_index_out_of_range ());
+ ind *= this->bounds [i].length;
+ ind += realidx;
}
+ esize *= ind;
- if (ind >= this->max_length)
- mono_raise_exception (mono_get_exception_index_out_of_range ());
-
- esize = mono_array_element_size (class);
- ea = (gpointer*)((char*)this->vector + (ind * esize));
+ ea = (gpointer*)((char*)this->vector + esize);
va_end(ap);
mono_class_static_field_address (MonoDomain *domain, MonoClassField *field)
{
MonoVTable *vtable;
+ gpointer addr;
MONO_ARCH_SAVE_REGS;
mono_class_init (field->parent);
vtable = mono_class_vtable (domain, field->parent);
+ if (!vtable->initialized)
+ mono_runtime_class_init (vtable);
//printf ("SFLDA1 %p\n", (char*)vtable->data + field->offset);
+ if (!domain->thread_static_fields || !(addr = g_hash_table_lookup (domain->thread_static_fields, field)))
+ addr = (char*)vtable->data + field->offset;
+ else
+ addr = mono_threads_get_static_data (GPOINTER_TO_UINT (addr));
- return (char*)vtable->data + field->offset;
+ return addr;
}
static gpointer
static guint64
mono_fconv_u8 (double v)
{
- MONO_ARCH_SAVE_REGS;
+ /* no need, no exceptions: MONO_ARCH_SAVE_REGS;*/
return (guint64)v;
}
static guint32
mono_fconv_u4 (double v)
{
- MONO_ARCH_SAVE_REGS;
+ /* no need, no exceptions: MONO_ARCH_SAVE_REGS;*/
return (guint32)v;
}