aboutsummaryrefslogtreecommitdiff
path: root/opcodes/riscv-dis.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2022-09-30 11:43:59 +0200
committerJan Beulich <jbeulich@suse.com>2022-09-30 11:43:59 +0200
commitb0423163b808c463fe35e861471f80123f0b309f (patch)
treecf356bb6f5e89dcbe4a82882fa5ba119d55ae768 /opcodes/riscv-dis.c
parent3bf4994276269a241d97f8ccb5171fe581baa4cb (diff)
downloadfsf-binutils-gdb-b0423163b808c463fe35e861471f80123f0b309f.zip
fsf-binutils-gdb-b0423163b808c463fe35e861471f80123f0b309f.tar.gz
fsf-binutils-gdb-b0423163b808c463fe35e861471f80123f0b309f.tar.bz2
RISC-V: fix build after "Add support for arbitrary immediate encoding formats"
Pre- and post-increment/decrement are side effects, the behavior of which is undefined when combined with passing an address of the accessed variable in the same function invocation. There's no need for the increments here - simply adding 1 achieves the intended effect without triggering compiler diagnostics (which are fatal with -Werror).
Diffstat (limited to 'opcodes/riscv-dis.c')
-rw-r--r--opcodes/riscv-dis.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c
index f2d3992..6ac6949 100644
--- a/opcodes/riscv-dis.c
+++ b/opcodes/riscv-dis.c
@@ -586,10 +586,10 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma pc, disassemble_info *info
sign = false;
goto print_imm;
print_imm:
- n = strtol (++oparg, (char **)&oparg, 10);
+ n = strtol (oparg + 1, (char **)&oparg, 10);
if (*oparg != '@')
goto undefined_modifier;
- s = strtol (++oparg, (char **)&oparg, 10);
+ s = strtol (oparg + 1, (char **)&oparg, 10);
oparg--;
if (!sign)