]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Broadens the range on INT imm8 values that SIGSEGV, allowing Jikes RVM
authorJulian Seward <jseward@acm.org>
Thu, 16 Feb 2012 12:36:47 +0000 (12:36 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 16 Feb 2012 12:36:47 +0000 (12:36 +0000)
to work.

Jikes RVM uses INT 0x3F through 0x49, assuming that they result in a
SIGSEGV. The x86 guest currently does this only for INT 0x40 through
0x43. The attached patch extends the range to 0x3F through 0x4F,
covering all existing Jikes RVM INTs and leaving room for it to add a
few more before it runs into this problem again.

Fixes #294185.  (Eliot Moss, moss@cs.umass.edu)

git-svn-id: svn://svn.valgrind.org/vex/trunk@2251

VEX/priv/guest_x86_toIR.c

index a19c604a74730fcc9f0a95a997323ae32cb73a0c..4b15c61e7cfebb8e49f6b0798c6b4ecaf3be3e72 100644 (file)
@@ -13074,12 +13074,14 @@ DisResult disInstr_X86_WRK (
          end-of-block here, which forces any TempRegs caching ArchRegs
          to be flushed. */
 
-      /* Handle int $0x40 .. $0x43 by synthesising a segfault and a
+      /* Handle int $0x3F .. $0x4F by synthesising a segfault and a
          restart of this instruction (hence the "-2" two lines below,
          to get the restart EIP to be this instruction.  This is
          probably Linux-specific and it would be more correct to only
-         do this if the VexAbiInfo says that is what we should do. */
-      if (d32 >= 0x40 && d32 <= 0x43) {
+         do this if the VexAbiInfo says that is what we should do.
+         This used to handle just 0x40-0x43; Jikes RVM uses a larger
+         range (0x3F-0x49), and this allows some slack as well. */
+      if (d32 >= 0x3F && d32 <= 0x4F) {
          jmp_lit(Ijk_SigSEGV,((Addr32)guest_EIP_bbstart)+delta-2);
          dres.whatNext = Dis_StopHere;
          DIP("int $0x%x\n", (Int)d32);