2009-02-03 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / mini / jit-icalls.c
index fc5602f3c627e7cd087f7e01ee0a0ac5c6e73f49..49aaa866546e29966d06cc80286967a322341545 100644 (file)
@@ -288,7 +288,7 @@ mono_irem_un (guint32 a, guint32 b)
 
 #endif
 
-#ifdef MONO_ARCH_EMULATE_MUL_DIV
+#if defined(MONO_ARCH_EMULATE_MUL_DIV) || defined(MONO_ARCH_EMULATE_MUL_OVF)
 
 gint32
 mono_imul (gint32 a, gint32 b)
@@ -307,7 +307,7 @@ mono_imul_ovf (gint32 a, gint32 b)
 
        res = (gint64)a * (gint64)b;
 
-       if ((res > 0x7fffffffL) || (res < -2147483648))
+       if ((res > 0x7fffffffL) || (res < -2147483648LL))
                mono_raise_exception (mono_get_exception_overflow ());
 
        return res;