diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-06-15 06:40:17 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-06-15 06:40:17 -0700 |
commit | 0d96e4df4812c3bad77c229dfef47a9bc115ac12 (patch) | |
tree | dd6b8d5036fe76d58922074da21ed2765e463223 /opcodes/i386-dis.c | |
parent | cd3ea7c69acc5045eb28f9bf80d923116e15e4f5 (diff) | |
download | gdb-0d96e4df4812c3bad77c229dfef47a9bc115ac12.zip gdb-0d96e4df4812c3bad77c229dfef47a9bc115ac12.tar.gz gdb-0d96e4df4812c3bad77c229dfef47a9bc115ac12.tar.bz2 |
i386-dis: Check valid bnd register
Since there are only 4 bnd registers, return "(bad)" for register
number > 3.
PR binutils/21594
* i386-dis.c (OP_E_register): Check valid bnd register.
(OP_G): Likewise.
Diffstat (limited to 'opcodes/i386-dis.c')
-rw-r--r-- | opcodes/i386-dis.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index b35dbc0..d461d08 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -15025,6 +15025,11 @@ OP_E_register (int bytemode, int sizeflag) names = address_mode == mode_64bit ? names64 : names32; break; case bnd_mode: + if (reg > 0x3) + { + oappend ("(bad)"); + return; + } names = names_bnd; break; case indir_v_mode: @@ -15569,6 +15574,11 @@ OP_G (int bytemode, int sizeflag) oappend (names64[modrm.reg + add]); break; case bnd_mode: + if (modrm.reg > 0x3) + { + oappend ("(bad)"); + return; + } oappend (names_bnd[modrm.reg]); break; case v_mode: |