From ddef71730870b2c99da47b78acda77d5505c161e Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Fri, 9 Sep 2005 13:05:20 +0000 Subject: [PATCH] re PR libgcj/22084 (Divide_1 test case hangs) 2005-09-08 Andrew Haley PR java/22084 * include/i386-signal.h (HANDLE_DIVIDE_OVERFLOW): Bump IP by 1 if R/M field in instruction is 100. From-SVN: r104094 --- libjava/ChangeLog | 6 ++++++ libjava/include/i386-signal.h | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 832028e61194..a167ac4c8c6f 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2005-09-08 Andrew Haley + + PR java/22084 + * include/i386-signal.h (HANDLE_DIVIDE_OVERFLOW): Bump IP by 1 if + R/M field in instruction is 100. + 2005-09-08 Thomas Fitzsimmons PR libgcj/23761 diff --git a/libjava/include/i386-signal.h b/libjava/include/i386-signal.h index f7b0edae6225..a5c8ae4bf54a 100644 --- a/libjava/include/i386-signal.h +++ b/libjava/include/i386-signal.h @@ -64,18 +64,25 @@ do \ if (_regs->eax == 0x80000000 \ && ((_modrm >> 3) & 7) == 7) /* Signed divide */ \ { \ + unsigned char _rm = _modrm & 7; \ _regs->edx = 0; /* the remainder is zero */ \ switch (_modrm >> 6) \ { \ - case 0: \ - if ((_modrm & 7) == 5) \ - _eip += 4; \ + case 0: /* register indirect */ \ + if (_rm == 5) /* 32-bit displacement */ \ + _eip += 4; \ + if (_rm == 4) /* A SIB byte follows the ModR/M byte */ \ + _eip += 1; \ break; \ - case 1: \ + case 1: /* register indirect + 8-bit displacement */ \ _eip += 1; \ + if (_rm == 4) /* A SIB byte follows the ModR/M byte */ \ + _eip += 1; \ break; \ - case 2: \ + case 2: /* register indirect + 32-bit displacement */ \ _eip += 4; \ + if (_rm == 4) /* A SIB byte follows the ModR/M byte */ \ + _eip += 1; \ break; \ case 3: \ break; \