{
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 ());
}
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;
}
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;
}
#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)
{