[binutils-gdb] opcodes/x86: fix minor missed styling case

Andrew Burgess aburgess@sourceware.org
Wed Jul 24 13:32:54 GMT 2024


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=28792287e8109b7b40bd28d43950439f12f251a7

commit 28792287e8109b7b40bd28d43950439f12f251a7
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Tue Jul 23 17:10:22 2024 +0100

    opcodes/x86: fix minor missed styling case
    
    I noticed that the x86 instruction:
    
      sar    $1,%rsi
    
    would fail to style the '$0x1' as an immediate.  This commit fixes
    that case.

Diff:
---
 opcodes/i386-dis.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index bc141f31770..59ec771369a 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -12415,9 +12415,9 @@ OP_I (instr_info *ins, int bytemode, int sizeflag)
       break;
     case const_1_mode:
       if (ins->intel_syntax)
-	oappend (ins, "1");
+	oappend_with_style (ins, "1", dis_style_immediate);
       else
-	oappend (ins, "$1");
+	oappend_with_style (ins, "$1", dis_style_immediate);
       return true;
     default:
       oappend (ins, INTERNAL_DISASSEMBLER_ERROR);


More information about the Binutils-cvs mailing list