Implement mono_arch_context_set_int_reg () for arm.
[mono.git] / mono / mini / jit-icalls.c
index b332d00204f58dceac179bb0d80705a45db42c8a..578cc35c1026841f43c1dda666ebf2e3bc2b230b 100644 (file)
@@ -74,6 +74,8 @@ mono_helper_stelem_ref_check (MonoArray *array, MonoObject *val)
 {
        MONO_ARCH_SAVE_REGS;
 
+       if (!array)
+               mono_raise_exception (mono_get_exception_null_reference ());
        if (val && !mono_object_isinst (val, array->obj.vtable->klass->element_class))
                mono_raise_exception (mono_get_exception_array_type_mismatch ());
 }
@@ -241,7 +243,7 @@ mono_idiv (gint32 a, gint32 b)
        if (!b)
                mono_raise_exception (mono_get_exception_divide_by_zero ());
        else if (b == -1 && a == (0x80000000))
-               mono_raise_exception (mono_get_exception_arithmetic ());
+               mono_raise_exception (mono_get_exception_overflow ());
 #endif
        return a / b;
 }
@@ -267,7 +269,7 @@ mono_irem (gint32 a, gint32 b)
        if (!b)
                mono_raise_exception (mono_get_exception_divide_by_zero ());
        else if (b == -1 && a == (0x80000000))
-               mono_raise_exception (mono_get_exception_arithmetic ());
+               mono_raise_exception (mono_get_exception_overflow ());
 #endif
 
        return a % b;
@@ -926,6 +928,16 @@ mono_lconv_to_r8_un (guint64 a)
 }
 #endif
 
+#if defined(__native_client_codegen__) || defined(__native_client__)
+/* When we cross-compile to Native Client we can't directly embed calls */
+/* to the math library on the host. This will use the fmod on the target*/
+double
+mono_fmod(double a, double b)
+{
+       return fmod(a, b);
+}
+#endif
+
 gpointer
 mono_helper_compile_generic_method (MonoObject *obj, MonoMethod *method, gpointer *this_arg)
 {