Hi,
>
> The following program causes the Linux JDK 1.1.7v3 to crash with a
> SIGFPE. This is because the x86 causes an arithmetic exception when
> you divide 0x80000000 by -1; the JVM spec, however, says that the result
> of this should be 0x80000000 with NO exception thrown. (The fix is to catch
If you use the TYA JIT please apply the following patch to fix this:
--- tyarecode.c.265 Sat Jun 19 19:35:49 1999
+++ tyarecode.c Fri Jun 25 18:40:47 1999
@@ -786,17 +786,18 @@
CW(TEST_AXAX);
CompTriggerDivZeroException(cinfo);
#endif
-#if 0
- CW(MOV_BXAX);
- CB(POPAX);
- CW(MOV_DXAX);
- CW(SAR_DX);
- CB(31);
-#else
CB(POPBX);
CB(XCHG_AXBX);
+ CB(CMP_AX);
+ CL(0x80000000);
+ CB(JNE);
+ CB(5);
+#define CMP_BX_BYTE 0xFB83 /* cmp ebx,yy */
+ CW(CMP_BX_BYTE);
+ CB(-1);
+ CB(JE);
+ CB(3);
CB(CDQ); // eax->edx:eax
-#endif
CW(IDIV_BX);
break;
case 0x6d: // ldiv
Thanks to Matt Welsh for detecting the bug.
Cheers
Albrecht
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]