]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Treat INT with an operand other than 0x80 as an undefined instruction.
authorTom Hughes <tom@compton.nu>
Sat, 6 Mar 2004 12:53:24 +0000 (12:53 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 6 Mar 2004 12:53:24 +0000 (12:53 +0000)
CCMAIL: 76839-done@bugs.kde.org

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2291

coregrind/vg_to_ucode.c
none/tests/.cvsignore
none/tests/Makefile.am
none/tests/filter_int [new file with mode: 0755]
none/tests/int.c [new file with mode: 0644]
none/tests/int.stderr.exp [new file with mode: 0644]
none/tests/int.stdout.exp [new file with mode: 0644]
none/tests/int.vgtest [new file with mode: 0644]

index 7feaf7d0f639b6c942d8a30e93c5b02f29e74fee..a63a4a52bf47c1dc11cf3fad52271d580c500f45 100644 (file)
@@ -5446,7 +5446,7 @@ static Addr disInstr ( UCodeBlock* cb, Addr eip, Bool* isEnd )
 
    case 0xCD: /* INT imm8 */
       d32 = getUChar(eip); eip++;
-      if (d32 != 0x80) VG_(core_panic)("disInstr: INT but not 0x80 !");
+      if (d32 != 0x80) goto decode_failure;
       /* It's important that all ArchRegs carry their up-to-date value
          at this point.  So we declare an end-of-block here, which
          forces any TempRegs caching ArchRegs to be flushed. */
index 97a4e6eea1452b3cbe6399f10a3b2b736821c1f5..8f314283ffe4a0cd8d6681a918d3bc2ccf48e39c 100644 (file)
@@ -28,6 +28,7 @@ insn_sse
 insn_sse.c
 insn_sse2
 insn_sse2.c
+int
 map_unmap
 munmap_exe
 mremap
index 67092611cb45560dd3ee4b91271cb41367492b1e..dfcb4449b3b93a7dc95a1a08a131c8ad7862aeb7 100644 (file)
@@ -31,6 +31,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
        insn_mmxext.stderr.exp insn_mmxext.stdout.exp insn_mmxext.vgtest \
        insn_sse.stderr.exp insn_sse.stdout.exp insn_sse.vgtest \
        insn_sse2.stderr.exp insn_sse2.stdout.exp insn_sse2.vgtest \
+       int.stderr.exp int.stdout.exp int.vgtest \
        map_unmap.stdout.exp map_unmap.vgtest \
        mremap.stdout.exp mremap.vgtest \
        munmap_exe.stderr.exp munmap_exe.vgtest \
@@ -58,7 +59,7 @@ check_PROGRAMS = \
        args bitfield1 bt_everything bt_literal closeall coolo_strlen \
        cpuid dastest discard exec-sigmask floored fork fpu_lazy_eflags \
        fucomip insn_basic insn_cmov insn_mmx insn_mmxext insn_sse insn_sse2 \
-       munmap_exe map_unmap mremap rcl_assert \
+       int munmap_exe map_unmap mremap rcl_assert \
        rcrl readline1 resolv seg_override sha1_test shortpush shorts smc1 \
        pth_blockedsig pushpopseg \
        syscall-restart1 syscall-restart2 system \
@@ -95,6 +96,7 @@ insn_sse_SOURCES      = insn_sse.def
 insn_sse_LDADD         = -lm
 insn_sse2_SOURCES      = insn_sse2.def
 insn_sse2_LDADD                = -lm
+int_SOURCES            = int.c
 map_unmap_SOURCES      = map_unmap.c
 mremap_SOURCES         = mremap.c
 munmap_exe_SOURCES     = munmap_exe.c
diff --git a/none/tests/filter_int b/none/tests/filter_int
new file mode 100755 (executable)
index 0000000..a742870
--- /dev/null
@@ -0,0 +1,6 @@
+#! /bin/sh
+
+dir=`dirname $0`
+
+$dir/filter_stderr | $dir/../../tests/filter_addresses
+
diff --git a/none/tests/int.c b/none/tests/int.c
new file mode 100644 (file)
index 0000000..8664ea7
--- /dev/null
@@ -0,0 +1,8 @@
+#include <stdlib.h>
+
+int main(int argc, char **argv)
+{
+  asm ("int $129");
+  
+  exit(0);
+}
diff --git a/none/tests/int.stderr.exp b/none/tests/int.stderr.exp
new file mode 100644 (file)
index 0000000..a37acd4
--- /dev/null
@@ -0,0 +1,8 @@
+
+disInstr: unhandled instruction bytes: 0x........ 0x........ 0x........ 0x........
+          at 0x........: main (int.c:5)
+
+Process terminating with default action of signal 4 (SIGILL): dumping core
+ Illegal operand at address 0x........
+   at 0x........: main (int.c:5)
+
diff --git a/none/tests/int.stdout.exp b/none/tests/int.stdout.exp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/none/tests/int.vgtest b/none/tests/int.vgtest
new file mode 100644 (file)
index 0000000..e2d09cd
--- /dev/null
@@ -0,0 +1,2 @@
+prog: int
+stderr_filter: filter_int