aboutsummaryrefslogtreecommitdiff
path: root/opcodes/aarch64-opc.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2019-11-11 13:27:47 +0100
committerJan Beulich <jbeulich@suse.com>2019-11-11 13:27:47 +0100
commit4f5fc85d6c6e33d8282f4c5164fb5187cdff96d1 (patch)
tree74399cf2e4a7ee5a9b32828e0d388b6f9bf74474 /opcodes/aarch64-opc.c
parent6f485ad41608601f6cd2740472ef4410bf419f6a (diff)
downloadgdb-4f5fc85d6c6e33d8282f4c5164fb5187cdff96d1.zip
gdb-4f5fc85d6c6e33d8282f4c5164fb5187cdff96d1.tar.gz
gdb-4f5fc85d6c6e33d8282f4c5164fb5187cdff96d1.tar.bz2
Arm64: fix build with old glibc
Some old glibc versions have string.h surface "index", which some compilers then warn about if shadowed by a local variable. Re-use an existing variable instead.
Diffstat (limited to 'opcodes/aarch64-opc.c')
-rw-r--r--opcodes/aarch64-opc.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/opcodes/aarch64-opc.c b/opcodes/aarch64-opc.c
index 11b04b5..61547b4 100644
--- a/opcodes/aarch64-opc.c
+++ b/opcodes/aarch64-opc.c
@@ -2546,17 +2546,14 @@ operand_general_constraint_met_p (const aarch64_opnd_info *opnds, int idx,
case AARCH64_OPND_SVE_SHRIMM_PRED:
case AARCH64_OPND_SVE_SHRIMM_UNPRED:
case AARCH64_OPND_SVE_SHRIMM_UNPRED_22:
+ num = (type == AARCH64_OPND_SVE_SHRIMM_UNPRED_22) ? 2 : 1;
+ size = aarch64_get_qualifier_esize (opnds[idx - num].qualifier);
+ if (!value_in_range_p (opnd->imm.value, 1, 8 * size))
{
- unsigned int index =
- (type == AARCH64_OPND_SVE_SHRIMM_UNPRED_22) ? 2 : 1;
- size = aarch64_get_qualifier_esize (opnds[idx - index].qualifier);
- if (!value_in_range_p (opnd->imm.value, 1, 8 * size))
- {
- set_imm_out_of_range_error (mismatch_detail, idx, 1, 8*size);
- return 0;
- }
- break;
- }
+ set_imm_out_of_range_error (mismatch_detail, idx, 1, 8*size);
+ return 0;
+ }
+ break;
default:
break;