aboutsummaryrefslogtreecommitdiff
path: root/opcodes/aarch64-asm.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2021-01-08 11:51:50 +0000
committerNick Clifton <nickc@redhat.com>2021-01-08 11:51:50 +0000
commite84c871648606f29f7d35084ab8afc3b522affc3 (patch)
tree90e2f5e816d9e038ec9b5e8f561f20297b360a4c /opcodes/aarch64-asm.c
parentfb932b57cbf99d01145cb4b5c0c64da9157c7f73 (diff)
downloadgdb-e84c871648606f29f7d35084ab8afc3b522affc3.zip
gdb-e84c871648606f29f7d35084ab8afc3b522affc3.tar.gz
gdb-e84c871648606f29f7d35084ab8afc3b522affc3.tar.bz2
Fix places in the AArch64 opcodes library code where a call to assert() has side effects.
PR 27129 * aarch64-dis.c (determine_disassembling_preference): Move call to aarch64_match_operands_constraint outside of the assertion. * aarch64-asm.c (aarch64_ins_limm_1): Remove call to assert. Replace with a return of FALSE.
Diffstat (limited to 'opcodes/aarch64-asm.c')
-rw-r--r--opcodes/aarch64-asm.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/opcodes/aarch64-asm.c b/opcodes/aarch64-asm.c
index 0eebf6b..eae652e 100644
--- a/opcodes/aarch64-asm.c
+++ b/opcodes/aarch64-asm.c
@@ -545,18 +545,19 @@ aarch64_ins_limm_1 (const aarch64_operand *self,
const aarch64_inst *inst, bfd_boolean invert_p,
aarch64_operand_error *errors ATTRIBUTE_UNUSED)
{
+ bfd_boolean res;
aarch64_insn value;
uint64_t imm = info->imm.value;
int esize = aarch64_get_qualifier_esize (inst->operands[0].qualifier);
if (invert_p)
imm = ~imm;
- /* The constraint check should have guaranteed this wouldn't happen. */
- assert (aarch64_logical_immediate_p (imm, esize, &value));
-
- insert_fields (code, value, 0, 3, self->fields[2], self->fields[1],
- self->fields[0]);
- return TRUE;
+ /* The constraint check should guarantee that this will work. */
+ res = aarch64_logical_immediate_p (imm, esize, &value);
+ if (res)
+ insert_fields (code, value, 0, 3, self->fields[2], self->fields[1],
+ self->fields[0]);
+ return res;
}
/* Insert logical/bitmask immediate for e.g. the last operand in