Treat INT with an operand other than 0x80 as an undefined instruction.
CCMAIL: 76839-done@bugs.kde.org
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2291 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_to_ucode.c b/coregrind/vg_to_ucode.c
index 7feaf7d..a63a4a5 100644
--- a/coregrind/vg_to_ucode.c
+++ b/coregrind/vg_to_ucode.c
@@ -5446,7 +5446,7 @@
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. */
diff --git a/none/tests/.cvsignore b/none/tests/.cvsignore
index 97a4e6e..8f31428 100644
--- a/none/tests/.cvsignore
+++ b/none/tests/.cvsignore
@@ -28,6 +28,7 @@
insn_sse.c
insn_sse2
insn_sse2.c
+int
map_unmap
munmap_exe
mremap
diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am
index 6709261..dfcb444 100644
--- a/none/tests/Makefile.am
+++ b/none/tests/Makefile.am
@@ -31,6 +31,7 @@
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 @@
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_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
index 0000000..a742870
--- /dev/null
+++ b/none/tests/filter_int
@@ -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
index 0000000..8664ea7
--- /dev/null
+++ b/none/tests/int.c
@@ -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
index 0000000..a37acd4
--- /dev/null
+++ b/none/tests/int.stderr.exp
@@ -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
index 0000000..e69de29
--- /dev/null
+++ b/none/tests/int.stdout.exp
diff --git a/none/tests/int.vgtest b/none/tests/int.vgtest
new file mode 100644
index 0000000..e2d09cd
--- /dev/null
+++ b/none/tests/int.vgtest
@@ -0,0 +1,2 @@
+prog: int
+stderr_filter: filter_int