[PATCH] opcodes/x86: fix minor missed styling case

Jiang, Haochen haochen.jiang@intel.com
Wed Jul 24 02:03:50 GMT 2024


> -----Original Message-----
> From: Andrew Burgess <aburgess@redhat.com>
> Sent: Wednesday, July 24, 2024 12:13 AM
> To: binutils@sourceware.org
> Cc: Andrew Burgess <aburgess@redhat.com>
> Subject: [PATCH] opcodes/x86: fix minor missed styling case
> 
> I noticed that the x86 instruction:
> 
>   sar    $0x1,%rsi
> 
> would fail to style the '$0x1' as an immediate.  This commit fixes that case.
> ---
>  opcodes/i386-dis.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index
> bc141f31770..d44fee33eb5 100644
> --- a/opcodes/i386-dis.c
> +++ b/opcodes/i386-dis.c
> @@ -12414,11 +12414,8 @@ OP_I (instr_info *ins, int bytemode, int
> sizeflag)
>  	}
>        break;
>      case const_1_mode:
> -      if (ins->intel_syntax)
> -	oappend (ins, "1");
> -      else
> -	oappend (ins, "$1");

It seems fixed the issue when the immediate is not decimal format right?

Thx,
Haochen

> -      return true;
> +      op = 1;
> +      break;
>      default:
>        oappend (ins, INTERNAL_DISASSEMBLER_ERROR);
>        return true;
> 
> base-commit: 40578beee8a593e3668852238fd8e9f53790f2c9
> --
> 2.25.4



More information about the Binutils mailing list