diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2010-04-16 21:35:24 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2010-04-16 21:35:24 +0000 |
commit | f07af43e36ba563e64297d71af3f702ee47ba665 (patch) | |
tree | 49a1e969a8c3ab16f86f9e3f4f43b04470fa047a | |
parent | f90824dcbc643d327b85e6db5f9cabba0a51aa85 (diff) | |
download | gdb-f07af43e36ba563e64297d71af3f702ee47ba665.zip gdb-f07af43e36ba563e64297d71af3f702ee47ba665.tar.gz gdb-f07af43e36ba563e64297d71af3f702ee47ba665.tar.bz2 |
Return bad_opcode on unknown bits in opcode.
2010-04-16 H.J. Lu <hongjiu.lu@intel.com>
* i386-dis.c (get_valid_dis386): Return bad_opcode on unknown
bits in opcode.
-rw-r--r-- | opcodes/ChangeLog | 5 | ||||
-rw-r--r-- | opcodes/i386-dis.c | 22 |
2 files changed, 22 insertions, 5 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 1e5b4de..b686fe0 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2010-04-16 H.J. Lu <hongjiu.lu@intel.com> + + * i386-dis.c (get_valid_dis386): Return bad_opcode on unknown + bits in opcode. + 2010-04-09 Nick Clifton <nickc@redhat.com> * i386-dis.c (print_insn): Remove unused variable op. diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 797d0bd..e5b45a1 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -11058,7 +11058,9 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info) switch ((*codep & 0x1f)) { default: - BadOp (); + dp = &bad_opcode; + return dp; + break; case 0x8: vex_table_index = XOP_08; break; @@ -11077,7 +11079,10 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info) vex.register_specifier = (~(*codep >> 3)) & 0xf; if (address_mode != mode_64bit && vex.register_specifier > 0x7) - BadOp (); + { + dp = &bad_opcode; + return dp; + } vex.length = (*codep & 0x4) ? 256 : 128; switch ((*codep & 0x3)) @@ -11115,7 +11120,8 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info) switch ((*codep & 0x1f)) { default: - BadOp (); + dp = &bad_opcode; + return dp; case 0x1: vex_table_index = VEX_0F; break; @@ -11134,7 +11140,10 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info) vex.register_specifier = (~(*codep >> 3)) & 0xf; if (address_mode != mode_64bit && vex.register_specifier > 0x7) - BadOp (); + { + dp = &bad_opcode; + return dp; + } vex.length = (*codep & 0x4) ? 256 : 128; switch ((*codep & 0x3)) @@ -11176,7 +11185,10 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info) vex.register_specifier = (~(*codep >> 3)) & 0xf; if (address_mode != mode_64bit && vex.register_specifier > 0x7) - BadOp (); + { + dp = &bad_opcode; + return dp; + } vex.w = 0; |